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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.