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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
Can you tell me what is wrong with this measure? I want the table to show sales for the last 5 months from today:
Solved! Go to Solution.
Hi @sw123 ,
You can try
CALCULATE(SUM(F_Invoice[Sales]),DATESBETWEEN(F_Invoice[Invoicedate],EDATE(EOMONTH(TODAY(),-1)+1,-5),EOMONTH(TODAY(),-1)+1))
or
Try using MAX instead of LASTDATE
Hi @sw123 ,
You can try
CALCULATE(SUM(F_Invoice[Sales]),DATESBETWEEN(F_Invoice[Invoicedate],EDATE(EOMONTH(TODAY(),-1)+1,-5),EOMONTH(TODAY(),-1)+1))
or
Try using MAX instead of LASTDATE
Thanx, still not working, though 😞
Now I read you blog more carefully and used the last updated simpler formula and it worked! Great thanx!
You can try:
Sales Period = CALCULATE(
SUM(F_Invoice[Sales]);all(F_Invoice[Invoicedate]);
DATESINPERIOD(F_Invoice[Invoicedate];
LASTDATE(F_Invoice[Invoicedate]);
-5;MONTH))
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Thanx, but it is still not working as it should 😞
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 17 | |
| 12 |