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.
amitchandak
4 years agoSuper User
Karlie69 , Try new column like
New column =
var _max = maxx(filter(Table, [part number] = earlier([part number]) && [year] = earlier([year]) -1), [Avr. Currency Price])
return
[Avr. Currency Price] -_max
- Karlie694 years agoRegular Visitor
Hi amitchandak ,
thanks for your answer. Unfortunately, it doesn't work and I don't know why.
I created the formula like this: