Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Thyago_Rezende
Resolver I
Resolver I

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.

 

issue power bi.png

 

 

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

Junho = June

Julho = July 

 

Can you help me, please?

1 ACCEPTED SOLUTION

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.

View solution in original post

4 REPLIES 4
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

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.

Greg_Deckler
Community Champion
Community Champion

Please post sample data.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Thyago_Rezende
Resolver I
Resolver I

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.

 

issue power bi.png

 

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors