###### Technical Articles # Calculating Variance using Cross calculations in SAC

Hi Guys,

In this blog post, we are about to see how to calculated the Current year (CY) Vs Previous Year (PY)  variance using cross calculation in SAC.

Let’s say we have created the model with the below dataset. Steps to find the Variance:

1. Create a model with the above sample data.
2. Create a story with the above created model
3. Drag and drop a table with the below measures and dimensions
4. 5. To find the variance, create cross calculation by enabling the check box under Columns as(on the right pane) shown in the below screen shot.
6. 7. After adding the cross calculations, add calculations as shown in the below screenshot
8. 9. When you add calculation, a new window pops up. In that, select ‘Restricted Measure’ in order to find CY Revenue by restricting the Measure (Revenue) to the current year as shown below.
10. 11. To do the step 9, Select  the measure as Account Values (as the Revenue has to be restricted), Select the Dimension as Year (as we are going the restrict the Revenue based on the year dimension) and select the values as per your requirement(In our case, the value should be 2020 as it is the current year).
12. 13. Similarly, create another Restricted Measure for previous year.
14. Inorder to find the variance, Create a ‘Calculated Measure’ with the formula CY Revenue – PY Revenue
15. 16. Now you will be able to see the CYPY variance in the table as shown in the below screenshot.
17. So, from the above steps, we can calculate the variance using cross calculation.

### Assigned Tags  