Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
I have all the data for the gross margin for this year and last year (two different columns).
The tricky part is the the calculation gives 4 scenarios:
A. Postive / negative = negative, but it's realy a positive growth vs LY
B. Positive / positive = OK to calculate
C. Negative / negative = positive, but in reality it an be a positive or negative result.
D. Negative / positive = negative
I'm having a hard time writing a DAX formula that takes these four scenarios into consideration.
This years coulmn name = GM FY
Last years coulmn name = GM LY
Solved! Go to Solution.
Hi @elkjoperik,
From my point of view, it is a business logic issue rather than a DAX formula issue. And it is better to use the following formula to calculate gross margin growth/decline in your scenario.
Growth = ( (Table2[GM FY]-Table2[GM LY])/ABS(Table2[GM LY]))*100 & "%"
For mode details, please review the example in the attached PBIX file.
Thanks,
Lydia Zhang
Hi @elkjoperik,
From my point of view, it is a business logic issue rather than a DAX formula issue. And it is better to use the following formula to calculate gross margin growth/decline in your scenario.
Growth = ( (Table2[GM FY]-Table2[GM LY])/ABS(Table2[GM LY]))*100 & "%"
For mode details, please review the example in the attached PBIX file.
Thanks,
Lydia Zhang
Thanks a lot, solved the issue!
bump, anyone ?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |