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
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
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.