Forum Discussion
Counting dimension's attribute distinct values
- 6 years ago
Hi guys,
The expanded version of Acquisti actually contains the full Fornitori table.
Therefore, if you use Acquisti as a filter argument in CALCULATE, you are filtering Fornitori too. CROSSFILTER is useless in this case. You could obtain the same performing a DISTINCTCOUNT, use CROSSFILTER avoiding the variable at all.
With that said, I would use something easier to read, like:
COUNTROWS ( SUMMARIZE ( Acquisti, Fornitori[Fornitore - Descrizione] ) )
Did not check performance, but it shouldn't be too bad, and definitely easier to read.
Only if you are counting the keys. If an attribute of the dimension is not unique (think at city, name, gender), then you need to use either SUMMARIZE or the expanded table. Or Bidirectional filtering... but you know, bidirectional cross-filter is like opening the door of Hell to say "Hello". Fascinating... but better stay away 🙂