Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Counting dimension's attribute distinct values

Hi guys, I need your help. I have to count the distinct suppliers from witch I made at least a purchase, given a certain filter context. Since the relationship between the dimension table of the su...
  • AlbertoFerrari's avatar
    AlbertoFerrari
    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.