Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 excel below, but when I try to get the same formula written in PBI I get an error saying too few arguments passed. Any help would be greatly appreciated.
Excel Formula
=IF(LY %=0,0,(IF(LY %<0,(( LY % - TY %)/ LY %)*100,(( LY % - TY %)/ LY %)*-100)))
PBI Measure
Solved! Go to Solution.
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] )
)
)
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] )
)
)
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] )
)
)
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] )
)
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 49 | |
| 44 | |
| 42 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 72 | |
| 67 | |
| 33 | |
| 32 | |
| 31 |