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.
I know the way I am trying to solve this is not elegant at all, but I do have a simple table called "HR Data" and a measure define like this:
I don't have any date structure, and I know this is not best practice, but can you please let me know how to do it ?
Thanks
A.
Solved! Go to Solution.
Heacount Employees One Year Before = CALCULATE(sum('HR Data'[Headcount Employees]),OFFSET(-4,allselected('HR Data'),MATCHBY('HR Data'[Index])))
Headcount Employees one year before =
CALCULATE(DISTINCTCOUNT('HR Data'[Employee Id]), SAMEPERIODLASTYEAR(Calendar[Date]))
(if you don't have a Calendar table then you should add one).
Thank you for the reply. I totally agree this should the right way of solving this, however I just need to build a quick proof of concept plus I am using bespoken quarters so a bit tricky to solve in that way.
I wouldn't suggest the solution I am trying to implement to anyone, but is there a simple way to fix my DAX instead ?
Thanks
A.
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Thanks, this is the expected outcome:
Heacount Employees One Year Before = CALCULATE(sum('HR Data'[Headcount Employees]),OFFSET(-4,allselected('HR Data'),MATCHBY('HR Data'[Index])))
Wonderful, works really well, thanks a lot !
A.
Check out the November 2025 Fabric 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!