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.
I'm not. I'm doing DISTINCTCOUNT( Dimension[DimAttribute] ), over a single-way relationship, and it's working the same as the CROSSFILTER() version of the formula.
Best
D
- Anonymous6 years agoNot applicableBut you should not use this technique as it can be slow and resource intensive. Use what I did above.
Best
D- Anonymous6 years agoNot applicable
Ok, but you may have to count the distinct number of dim attributes that don't have the same granularity of the dimension's key, e.g. the supplier's country. The point is that filter propagation in DAX is still not entirely clear to me.
Thanks
Bye!