Forum Discussion
Card14x
7 years agoRegular Visitor
% Change Year over Year
Hi, I am trying to create a measure formula that calculates the % change year over year that also takes into account changes from negative to positive numbers. I have the formula written out in e...
- 7 years ago
You have an extra IF towards the end. Should be
% Change Calculated = IF ( [LY Shortage Rate Calculated] = 0, 0, IF ( [LY Shortage Rate Calculated] > 0, ( [LY Shortage Rate Calculated] - [TY Shortage Rate Calculated] / [LY Shortage Rate Calculated] ) * -1, ( [LY Shortage Rate Calculated] ##You had an extra IF here - [TY Shortage Rate Calculated] / [LY Shortage Rate Calculated] ) ) ) - 7 years ago
Thanks for the quick reply Dedelman_clng! I added in some divides into the formula with your change and it worked perfectly.
% Change Calculated = IF ( [LY Shortage Rate Calculated] = 0, 0, IF ( [LY Shortage Rate Calculated] > 0, **DIVIDE** ( [LY Shortage Rate Calculated] - [TY Shortage Rate Calculated] , [LY Shortage Rate Calculated] ) * -1, **DIVIDE**( [LY Shortage Rate Calculated] - [TY Shortage Rate Calculated] , [LY Shortage Rate Calculated] ) ) )
dedelman_clng
7 years agoCommunity Champion
You have an extra IF towards the end. Should be
% Change Calculated =
IF (
[LY Shortage Rate Calculated] = 0,
0,
IF (
[LY Shortage Rate Calculated] > 0,
( [LY Shortage Rate Calculated]
- [TY Shortage Rate Calculated] / [LY Shortage Rate Calculated] )
* -1,
( [LY Shortage Rate Calculated] ##You had an extra IF here
- [TY Shortage Rate Calculated] / [LY Shortage Rate Calculated] )
)
)- Card14x7 years agoRegular Visitor
Thanks for the quick reply Dedelman_clng! I added in some divides into the formula with your change and it worked perfectly.
% Change Calculated = IF ( [LY Shortage Rate Calculated] = 0, 0, IF ( [LY Shortage Rate Calculated] > 0, **DIVIDE** ( [LY Shortage Rate Calculated] - [TY Shortage Rate Calculated] , [LY Shortage Rate Calculated] ) * -1, **DIVIDE**( [LY Shortage Rate Calculated] - [TY Shortage Rate Calculated] , [LY Shortage Rate Calculated] ) ) )