Reputation: 171
In my power Bi I would like to count rows for all my tables and having this output:
Table Name | Row count |
---|---|
Table1 | 126 |
Table2 | 985 |
Table3 | 998 |
... | ... |
As long as I have few tables I can do
NEWTABLE = UNION(
ROW("TableName","Table1", "Rowcount",ROWSCOUNT(Table1)),
ROW("TableName","Table2", "Rowcount",ROWSCOUNT(Table2)),
...
)
But this starts to be complicated when I have many tables. Is there a way I can do it? Like a loop or something? Thank you
Upvotes: 1
Views: 2028
Reputation: 3741
If you only need a metrics then you can use DaxStudio -> ViewMetrics
where cardinality is your "rowCounts"
If you need something more, then you can get all table name from DMV
select * from $SYSTEM.TMSCHEMA_TABLES
populate this as another table in your model, and use M language to loop through.
here useful example:
Upvotes: 1