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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Solved! Go to Solution.
Hi @SJHardeman
First, here's a bit of an explanation of what's going on:
Here is a good article on this overall topic:
https://www.sqlbi.com/articles/understanding-context-transition-in-dax/
A couple of side points:
You can fix this a few ways. I would personally recommend creating these measures:
FTE Sum =
SUM ( data[FTE] )
FTE First Month =
CALCULATE(
[FTE Sum],
FIRSTDATE ( data[Period] )
)
FTE Last Month =
CALCULATE(
[FTE Sum],
LASTDATE ( data[Period] )
)
FTE_change =
[FTE Last Month] - [FTE First Month]
Does this work for you?
Regards
Hi again @SJHardeman
This should work:
FTE Penultimate Month =
CALCULATE (
[FTE Sum],
PREVIOUSMONTH (
LASTDATE ( Staff_Collated_HQ_WFPT[Period] )
)
)
Notes:
As a general comment, I would highly recommend creating a Date/Calendar dimension table and using it for all date filtering.
(See this article for example https://www.daxpatterns.com/standard-time-related-calculations/)
This is because time intelligence functions such as LASTDATE and PREVIOUSMONTH base their logic on dates that exist in the date column provided (in your case the Period column). With more complex date filters, things can go awry if you don't have a Date table with contiguous dates and complete months that is marked as a date table.
Regards
Hi @SJHardeman
First, here's a bit of an explanation of what's going on:
Here is a good article on this overall topic:
https://www.sqlbi.com/articles/understanding-context-transition-in-dax/
A couple of side points:
You can fix this a few ways. I would personally recommend creating these measures:
FTE Sum =
SUM ( data[FTE] )
FTE First Month =
CALCULATE(
[FTE Sum],
FIRSTDATE ( data[Period] )
)
FTE Last Month =
CALCULATE(
[FTE Sum],
LASTDATE ( data[Period] )
)
FTE_change =
[FTE Last Month] - [FTE First Month]
Does this work for you?
Regards
Hi Owen, thanks for explaining this so clearly. The solution worked. Thanks, Sam
Hi @OwenAuger, how would I modify the code if I wanted to also have another measure which calculated FTE_change for [FTE Last Month] - [FTE Penultimate Month]. Using the below
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
14 | |
11 | |
10 | |
9 |