Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a staff Count in Months from April 2021 - Aug 2023. I also have another staff Count for April 2023 - Aug 2025. The data looks as below
Im trying to do a table which compares each month
Example:
April 2021 - 225 staff April 2023 - 220 Staff
Any help would be appreciated
Hi @Keiser - you should consider using the PARALLELPERIOD dax function to change the filter context. This allows you to specify a number of intervals. This would include 2 YEAR. The function would look something like this:
Function Name = CALCULATE ( [Count of Employees] , PARALLELPERIOD ( 'Date'[Date] , 2 , YEAR ) )
So this is the dax for how I get i get my staff count from April 2021-Aug 2023
This gives me a table like this
When I enter the Dax to shift 2 years:
This is the Outcome
Sorry Im new to power BI and Im probebly doing somthing wrong
Hi @Keiser , my suggestion to use the Parallelperiod would result in two measures. Current Month and Comparative Month, but I did not realise that you how your "pre suspension staff count" was working.
Instead of using the Parallelperiod, you will need to modified the "selectedDate" variable to shift it by 2 years. Consider the following examples:
DateCurrent = MIN( 'Calendar'[Date] )
DataAdd = CALCULATE( MIN( 'Calendar'[Date] ) , DATEADD( 'Calendar'[Date] , 2, YEAR ) )
Hi @Keiser , Could you please confirm that the comparative periods are always same month 2 years apart? e.g. do you want the ability to compare March 2023 to April 2024 or April 2025?
Yes just want to compare 2 years apart 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.