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
Exceuse me please
I 'm trying the dax formula for district count number of customer 3 month ago,
I used formula
But it mistake
As following below picture
Thank you for your helphttps://drive.google.com/file/d/1UzeeB14hWkPPSdXfqVIQJbosFekPkq78/view?usp=sharing
Hi @daedah,
Edate function might be helpful for you.
Please check following measure and see if the result achieve your expectation:
sum_last3month =
VAR l3 =
EDATE ( MAX ( 'Table'[Date] ), -3 )
VAR d =
MAX ( 'Table'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Customer] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] < d && 'Table'[Date] >= l3 )
)
Result would be shown as below:
BTW, Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
excuse me please
It formula don't show value
Recommend again please
Hi @daedah ,
As we can see in the picture, the "customer" column in my sample data actually is "number of customers".
If the "customer" column in your data is "name of customers", please replace "SUM ( 'Table'[Customer] )" to "DISTINCTCOUNT('Table'[Customer])"
Best Regards,
Jay
Hi,
Replace SUM ( 'Table'[Customer] ) with DISTINCTCOUNT('Table'[Customer])
Hope this helps.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |