Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi everyone,
I'm trying to create a measure that calculates the % increase/decrease between the sum of operating profit month to date, and the sum of operating profit during the same time period last month.
The first part of the formula is pretty straigthforward using the TotalMTD function. Could anyone tell me how to create a dynamic measure that calculates the sum of profit between this day last month and the start date of last month?
Thank you,
Alex
Solved! Go to Solution.
You haven't mentioned the table and column names, but it should be something like this.
profit last month td = CALULATE(SUM(fact_table[sales]),DATEADD(DATESMTD('date_table'[date]),-1, MONTH))
You haven't mentioned the table and column names, but it should be something like this.
profit last month td = CALULATE(SUM(fact_table[sales]),DATEADD(DATESMTD('date_table'[date]),-1, MONTH))
Thank you @sjoerdvn, somebody on a different forum suggested the exact same solution and it worked.
Hi @AlexIsac16 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _today=TODAY()
var _date=DATE(YEAR(_today),MONTH(_today)-1,1)
var _laststart=
MINX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(_date)&&MONTH('Table'[Date])=MONTH(_date)),[Date])
var _lastcurrent=
DATE(
YEAR(_today),MONTH(_today)-1,DAY(_today))
return
SUMX(
FILTER(ALL('Table'),
'Table'[Date]>=_laststart&&'Table'[Date]<=_lastcurrent),[Value])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |