Forum Discussion
Compare Staff Counts in Years
Hi Anonymous - 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 ) )
- Anonymous4 years agoNot applicable
Anonymous ,
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
- Anonymous4 years agoNot applicable
Hi Anonymous , 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 ) )