Forum Discussion
Count rows in table visual with Field Parameters
- 4 years ago
It's a two step process. Check the article at sqlbi.com . Fields parameters in Power BI - SQLBI
Unfortunately it is not (yet) possible to provide lists of columns instead of individual columns
Rowcount =
SWITCH(concatenatex(parameter,[Parameter],","),
"ACCOUNTING_PERIOD",COUNTROWS(SUMMARIZE(ALLSELECTED('ledger_fy22_qtr1'),[ACCOUNTING_PERIOD])),
"FISCAL_YEAR",COUNTROWS(SUMMARIZE(ALLSELECTED('ledger_fy22_qtr1'),[FISCAL_YEAR])),
COUNTROWS(SUMMARIZE(ALLSELECTED('ledger_fy22_qtr1'),[FISCAL_YEAR],[ACCOUNTING_PERIOD]))
)
Hi lbendlin ,
if we have 2 field parameters on our table visual how would that measure look?
And if the Field Parameter has columns from different tables?
Imagine a table visual with field parameter like below:
and
Thanks.
- lbendlin3 years agoSuper User
Same methodology. Instead of permutations for two columns your SWITCH statement needs to handle permutations over three columns.
The measures field parameters are irrelevant as they don't contribute cardinality.
- gp103 years agoAdvocate III
True, measures are irrelevant.
The thing is the different tables, not the number of columns.
So for example if I have columns from 4 different tables what would I write here?COUNTROWS(SUMMARIZE(ALLSELECTED('ledger_fy22_qtr1'),[FISCAL_YEAR],[ACCOUNTING_PERIOD])) - lbendlin3 years agoSuper User
use the same query as the visual uses when you combine these columns from different tables. SUMMARIZECOLUMNS etc.