Forum Discussion

Atif's avatar
Atif
Resolver I
5 years ago
Solved

Filtered Total

Distribution = DIVIDE( DISTINCTCOUNT( Table1[Brand Availability]), CALCULATE( DISTINCTCOUNT( Table1[Store ID]), ALL(Table1)))
 
This formula is working fine, as each value gets divided by the Total Distinct Count. However, when a filter is applied, the Total Distinct Count gets filtered, but the numerator still gets divided by the Total Distinct Count rather than the Filtered Total Distinct Count.
  • Atif's avatar
    Atif
    5 years ago

    Thank you, DataInsights !

     

    It is not displaying the exact percentages while using your formula. I will recheck later. Some filters are also applied, and it might be the cause.

     

    I have already got the job done with a mere tweaking.

     

    Distribution = DIVIDE( DISTINCTCOUNT( Table1[Brand Availability]), CALCULATE( DISTINCTCOUNT( Table1[Store ID]), ALL(Table1[Brand])))

2 Replies

  • Atif,

     

    Try this measure. It uses ALLSELECTED, instead of ALL.

     

    Distribution =
    DIVIDE (
        DISTINCTCOUNT ( Table1[Brand Availability] ),
        CALCULATE ( DISTINCTCOUNT ( Table1[Store ID] ), ALLSELECTED ( Table1 ) )
    )

     

    • Atif's avatar
      Atif
      Resolver I

      Thank you, DataInsights !

       

      It is not displaying the exact percentages while using your formula. I will recheck later. Some filters are also applied, and it might be the cause.

       

      I have already got the job done with a mere tweaking.

       

      Distribution = DIVIDE( DISTINCTCOUNT( Table1[Brand Availability]), CALCULATE( DISTINCTCOUNT( Table1[Store ID]), ALL(Table1[Brand])))