Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi - I'm sure this is a really simple question, but how do I get a result that isn't -100% when attempting to calculate growth when the prior year sales is zero? i.e. I have vendors that joined the company this year, and they don't have sales from last year.
My current DAX is:
Solved! Go to Solution.
Hello,
You could try something like:
COGS growth YTD = IF([COGS PYTD] <> 0, DIVIDE([COGS YTD],[COGS PYTD],0)-1, "[NaN]")
Since you are working with percentages, having 0 as your starting point can be tricky. The above dax could be used if calculating ones growth who has no prior sales is not a requirement. If it is necessary, consider replacing "[NaN]" with a separate calculation that determines ones growth based off of different parameters. For example, you could compare their growth by comparing this month to last month.
Let me know if you have any other questions.
Hello,
You could try something like:
COGS growth YTD = IF([COGS PYTD] <> 0, DIVIDE([COGS YTD],[COGS PYTD],0)-1, "[NaN]")
Since you are working with percentages, having 0 as your starting point can be tricky. The above dax could be used if calculating ones growth who has no prior sales is not a requirement. If it is necessary, consider replacing "[NaN]" with a separate calculation that determines ones growth based off of different parameters. For example, you could compare their growth by comparing this month to last month.
Let me know if you have any other questions.
Thank you - let me give that a shot and see how it looks.
Were you able to fix this?
Yes - it absolutely worked. Thank you!
User | Count |
---|---|
80 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |