Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Shure846
Helper III
Helper III

Calculating growth - result if prior year result is zero?

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: 

COGS growth YTD = DIVIDE([COGS YTD],[COGS PYTD],0)-1
 
I appreciate the help!~ 
1 ACCEPTED SOLUTION
srpeters
Helper II
Helper II

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.

View solution in original post

4 REPLIES 4
srpeters
Helper II
Helper II

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! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors