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!View all the Fabric Data Days sessions on demand. View schedule
Hello Power BI community.
Previously I had some data that were loaded with the last day of each month. It had the following measure:
Now the data is uploaded with the 15th of each month. That is, the January data is for 15-01-2023, the February data for 15-02-2023 and so on. I have used two different measures but none has worked for me:
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Here are the steps you can follow:
1. Create measure.
The last day of the previous month for the current date in the table:
Last Month =
var _plan=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(MAX('Board'[Date]))),[Date])),[Plan Oil])
var _Real=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(MAX('Board'[Date]))),[Date])),[Real Oil])
return
DIVIDE(
_plan,_Real)
Today is the last day of last month
Last Month Today =
var _plan=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(TODAY())-1),[Date])),[Plan Oil])
var _Real=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(TODAY())-1),[Date])),[Real Oil])
return
DIVIDE(_plan,_Real)
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
Hi @Syndicate_Admin ,
Here are the steps you can follow:
1. Create measure.
The last day of the previous month for the current date in the table:
Last Month =
var _plan=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(MAX('Board'[Date]))),[Date])),[Plan Oil])
var _Real=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(MAX('Board'[Date]))),[Date])),[Real Oil])
return
DIVIDE(
_plan,_Real)
Today is the last day of last month
Last Month Today =
var _plan=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(TODAY())-1),[Date])),[Plan Oil])
var _Real=
SUMX(
FILTER(ALL('Board'),
'Board'[Date]=
MAXX(FILTER(ALL(Board),MONTH('Board'[Date])=MONTH(TODAY())-1),[Date])),[Real Oil])
return
DIVIDE(_plan,_Real)
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
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!