Forum Discussion
zflory
Helper I
8 years agoYear over Year Comparison
Hello, I am currently have a matrix that displays Volume and Plant Margin by Volume. How would I be able to show a year over year comparison for these 2 categories? I have all of the data for 201...
zflory
Helper I
8 years agothank you nickchobotar. Can you see the below volumes? The difference between them is shown on the right (25966). Is there any way to display negative values for the 2017 data - 2016 data? I want it to show -25966, not 25966
nickchobotar
Skilled Sharer
8 years ago
If I am understanding correctly, you are trying to force your numbers to be negative.
If so, then you can use a minus in front of your numbers wrapped in absolute function, as shown below:
YoY Value =
VAR YearFraction = YEARFRAC(DATE(YEAR(TODAY()), 1, 1), TODAY()) // Get Year fraction for 2017
VAR Value2016 =
CALCULATE ( SUM ( Combined[One ] ) * YearFraction , Combined[Year] = 2016 ) // adjust 2016 volumes to 2017 through year fraction adjusting factor
VAR Value2017 =
CALCULATE ( SUM ( Combined[One ] ), Combined[Year] = 2017 )
VAR Result = - (ABS(Value2017) - ABS(Value2016))
RETURN
Result
Did I understand you correctly? Do you want turn all numbers into negative or just turn the positive numbers into negative?