Forum Discussion

sv98917n's avatar
sv98917n
Helper I
5 years ago

How to subtract values from the same column

Hello all, 

 

I am currently trying to create a parameter that shows a week over week difference. I have a slicer up to based on weeks and a table below with values for each week. I would like to show the difference.

 

I currently have the current calculated column, but it is giving me the wrong result. I've changed the datatypes on the calculated column and it still doesn't do anything. 

 

So in this case we are looking at weeks 24-29

 

diff =
Tons[Value]
- CALCULATE (
SUM ( Tons[Value] ),
FILTER ( Tons, Tons[Calendar Week Number] = EARLIER ( Tons[Calendar Week Number] ) - 1 )
)
 
 

So ultimately I would like the diff column to be 55.4k-55.7k , 54.9k-55.4k etc. to show that weekly change.

 

Any help is greatly appreciated.

 

Thank you! 

 

3 Replies