Forum Discussion
year over year variable
Thank you for your help on this, I am almost there I think
Here is my formula
PrioryearSales = CALCULATE(SUM('Sales Data Structure'[AMOUNT]),ALL('Sales Data Structure'[AMOUNT]),PREVIOUSYEAR('Sales Data Structure'[Shipping Date]))
The table looks like this, it is a list of individual invoices that I am summing up using the Amount column
| DOCUMENT NO. | Z-NUMBER | SHIPPING DATE | AMOUNT | SHIP TO STATE | Rep |
| 6618 | 296 | 10/8/2013 | $ - | OK | RL |
| 16458-1 | 410 | 10/8/2013 | $ 35,464.00 | WI | |
| 16529-2 | 410 | 10/8/2013 | $ 30,628.00 | WI | |
| 16626 | 210 | 10/9/2013 | $ 1,980.00 | FL | RL |
| 16607 | 220 | 10/9/2013 | $ 2,240.00 | WI | JTS |
| 16547 | 220 | 10/9/2013 | $ 160.00 | WI | JTS |
| 16596 | 220 | 10/9/2013 | $ 101.00 | WI | JTS |
| 16558 | 229 | 10/9/2013 | $ 810.00 | IN | |
| 16610 | 231 | 10/9/2013 | $ 3,570.00 | WI | JTS |
| 16609 | 231 | 10/9/2013 | $ 2,460.00 | WI | JTS |
In your provided information, your formula should work.
- Anonymous10 years agoNot applicable
It doesn't error out it just shows up blank
- v-qiuyu-msft10 years agoCommunity Support
Hi Anonymous,
Would you please provide more information about "it just shows up blank"?
To calculate difference among each year. You can create a calculated table group by the year and create a calculated column to return the previous year amount for each row, then create another calculated column to return difference. I have created a sample .PBIX file for your reference, you can take a look it to check if it can meet your requirements.
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu