Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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?
Solved! Go to 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.
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.
Please post sample data.
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |