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,
I'm looking for ways to get data for PREVIOUSMONTH if we select multiple months. I just need the data for the previous month of the max selected date. If we select Jan till June, i want the sales data for May, which is the same if I select June only.
I've tried CALCULATE([SalesSum],FILTER(CalendarTable, DATEADD(CalendarTable[Date], -1,MONTH))) but it doesn't work. Appreciate any help here.
Thanks !
Solved! Go to Solution.
Hi, @Velvetine27
You can try the following methods.
Sample data:
Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Month]=MAX('Table'[Month])-1))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Velvetine27
You can try the following methods.
Sample data:
Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Month]=MAX('Table'[Month])-1))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MaxSelectedDate = MAX('Table'[Date])
PreviousMonthSales = CALCULATE( SUM('Table'[Sales]),
DATEADD('Table'[Date], -1, MONTH) = [MaxSelectedDate] )
Hi, there's an error to this dax, "A function 'DATEADD' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
TRY this once,
MaxSelectedDate = MAX('Table'[Date])
PreviousMonthSales = CALCULATE( SUM('Table'[Sales]),
DATESINPERIOD('Table[Date],MaxSelectedDate, -1,Month))
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 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |
| User | Count |
|---|---|
| 25 | |
| 22 | |
| 19 | |
| 17 | |
| 10 |