Using the PARALLELPERIOD function
A common requirement for BI reporting is to show performance based on periods. Examples include reporting on this month versus last month, this quarter versus last quarter, or this year versus last year. In each of these instances you are calculating the totals based on the time frame required. DAX includes the PARALLELPERIOD
function to create these types of comparisons.
How to do it...
Open the Model.bim to the CRASH_DATA_T table.
In the measure creation area, click on an empty cell to create a measure to return the number of accidents using year:
ParallelPeriod:=CALCULATE( COUNT(CRASH_DATA_T[CASENUMBER]), PARALLELPERIOD(Calc_Date_T[CRASH_DATE], -1,YEAR))
This returns the total number of records in the table by year excluding the year 2006:
By looking at the total number of records per year in the ParallelPeriod column you can see how records were returned the prior year. For instance, in 2015...