Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Distinct Counts on Filtered Table

I'm having some trouble getting the intended distinct count numbers on a filtered table. From the results I'm seeing it appears as though the filtered table isn't actually filtered, so I'm not sure i...
  • Richard_100's avatar
    4 years ago

    Hello

     

    I was able to show your required data using this measure:

     

    TEST TOTAL UNIQUE COUNT 2 =
    CALCULATE(
    DISTINCTCOUNT('Test Table'[Super Bowl Ad Link]),
    ALL('Category Table'[Category])
    )
     
    Putting the ALL against the 'Category Table' rather than the 'Test Table' removes the "= Animals" filter over the table, making the DISTINCTCOUNT work.  I also used the DISTINCTCOUNT formula directly within the CALCULATE instead of referencing the [TEST UNIQUE COUNT] measure to avoid the hidden nested CALCULATE stuff
     

     

    Hope that helps

     

    Regards

    Richard