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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Saloni_Gupta
Helper I
Helper I

DIVIDE function not handling division by zero

Hi All,
I have a simple dax calculation for Revenue and EM% as below:

Revenue - FYTD =
var temp = CALCULATE(SUM('FactMonthlyRevenueandBudget'[ActualsRevenue]),'Month Table'[YTD Flag] = "Y")
RETURN
IF(temp = 0,BLANK(),temp)
EM % - FYTD =
var Result = DIVIDE([EM $ - FYTD],[Revenue - FYTD])
RETURN
IF(not ISBLANK([Revenue - FYTD]) || [Revenue - FYTD] <> 0,Result)

Although Divide function has the ability to handle division by zero but for 1 special case, when this Revenue aggregates to 0 in Totals as shown below for jobid starting with "595", my EM% values gives me this weird value.
Saloni_Gupta_2-1707932658834.png

 

Saloni_Gupta_3-1707932994526.png

 

Can you please help me resolve this issue as I dont want to show any EM% value if Revenue is 0 or blank?

 


 

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

It's seems it's not zero on that row but a small number. Try to use the round function to see if it's the real problem





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

1 REPLY 1
_AAndrade
Super User
Super User

It's seems it's not zero on that row but a small number. Try to use the round function to see if it's the real problem





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors