Forum Discussion
Jcastill
6 years agoRegular Visitor
subtraction same colum
Hello Community, someone can help me. I am nes in BI how can I do a subtract between 2 values on the same column (Matrix chart) here my data in the matrix cha
- 6 years ago
Hi Jcastill ,
You need a calendar table and create relationships with the fact table.
Then create measure like this:
Subtract Previous Year = var VarThis = SUM('Table'[value]) var LastYear =CALCULATE(SUM('Table'[value]),dateadd('Table 2'[date],-1,YEAR)) return IF( VarThis - LastYear = 0, VarThis, VarThis - LastYear)Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
6 years agoCommunity Champion
Jcastill - If you want this in the Totals row, see this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907