Forum Discussion
Karlie69
4 years agoRegular Visitor
Difference between values in the same column for unique index
Hi 🙂 I am having trouble calculating the difference between values in the same column. My dataset is like this: I added a matrix table based on this data to the dasboard that looks like ...
- Anonymous4 years ago
Hi Karlie69 ,
difff = var _pre=CALCULATE(SUM('Table'[Avr]),FILTER('Table',[Part_no]=EARLIER('Table'[Part_no]) && [Year]=EARLIER([Year])-1)) return IF(_pre=BLANK(),BLANK(), [Avr]-_pre)If it's not your expected output, please share more detail information to help us clarify your scenario.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Karlie69 ,
difff =
var _pre=CALCULATE(SUM('Table'[Avr]),FILTER('Table',[Part_no]=EARLIER('Table'[Part_no]) && [Year]=EARLIER([Year])-1))
return IF(_pre=BLANK(),BLANK(), [Avr]-_pre)
If it's not your expected output, please share more detail information to help us clarify your scenario.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Karlie69
4 years agoRegular Visitor
Thank you very much! It works 🙂 I just changed the formula from SUM to AVERAGE, because in some places I had bad results, but now it's good everywhere.