Forum Discussion

Thyago_Rezende's avatar
Thyago_Rezende
Icon for Resolver I rankResolver I
9 years ago
Solved

Distinct Count over entire Calendar table

I need to retrieve the DISTINCTCOUNT customers only for the last buy it. But, my measure return the DISTINCT COUNT for every month. The picture below shows the behavior.

 

 

 

The measure shows the calculation for all months, instead the month with last buy.

Junho = June

Julho = July 

 

Can you help me, please?

  • Hi Anonymous, Greg_Deckler

     

    I got it. The prior formula was correct. The filter context applied on Customer Table have changed the results. But, I didn´t understand that behavior it.

4 Replies

  • I need to retrieve the DISTINCTCOUNT customers only for the last buy it. But, my measure return the DISTINCT COUNT for every month. The picture below shows the behavior.

     

     

     

    The measure shows the calculation for all months, instead the month with last buy.

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Thyago_Rezende,

     

    You can use 'lastdate','all' functions to achieve your requirement.

    Measure = CALCULATE(DISTINCTCOUNT('Table'[Client]),FILTER(ALL('Table'),[Date]=LASTDATE(ALL('Table'[Date]))))

    Regards,

    Xiaoxin Sheng

    • Thyago_Rezende's avatar
      Thyago_Rezende
      Icon for Resolver I rankResolver I

      Hi Anonymous, Greg_Deckler

       

      I got it. The prior formula was correct. The filter context applied on Customer Table have changed the results. But, I didn´t understand that behavior it.