Calculating Year over Year Growth
You can leverage the measures you created that use PARALLELPERIOD
function to calculate the growth over periods. In this recipe, you will create a measure to see if the number of crashes increased or decreased year by year.
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:
YOY_Growth:=([Records]-[ParallelPeriod])/[ParallelPeriod]
Then press Enter to create the measure.
Now deploy the solution to the server and switch to SQL Server Management Studio to view the results. Browse the model and select the YEAR, Records, ParallelPeriod, and YOY_Growth columns:
You will see the percentage growth for each year in the results. Notice that the first value for YOY_Growth is labeled Infinity. This is due to the formula not having a value for data prior to the year 2006. To correct this error, you need to modify the measure to...