Forum Discussion

Chris_23's avatar
Chris_23
Icon for Helper II rankHelper II
1 year ago
Solved

Distincount in a Matrix with different Levels

Hello community,

 

I have a matrix with 3 levels. When the second level is open, a sum is calculated over the third and second levels. Otherwise, there is an 'X'. Now, I want to know for each row how many values from the second level are used to calculate sums, within the respective filter context. In the corresponding example, the value '7' should be assigned for each entry

 

Distinctcount.pbix

 

 

What do I need to adjust so that the measure delivers the desired result?

 

Thank you

Chris

  • Hi Chris_23 

    This should do the trick:

     

    Distinctcount = CALCULATE(DISTINCTCOUNT(Master[Name]), Filter(All(Master[Name]), [Sum]<> "X"),REMOVEFILTERS(Master[Region]))

    Let me know if this is not what you were after.

1 Reply

  • dk_dk's avatar
    dk_dk
    Icon for Super User rankSuper User

    Hi Chris_23 

    This should do the trick:

     

    Distinctcount = CALCULATE(DISTINCTCOUNT(Master[Name]), Filter(All(Master[Name]), [Sum]<> "X"),REMOVEFILTERS(Master[Region]))

    Let me know if this is not what you were after.