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
Anonymous
Not applicable

error using divide function

Hi colleagues,

 

I have a filter called "site name".

When I use the dax calculation bellow using alternateresult = 1  powerbi ignore the "site name filter". What a mass. I don't know how to solve it.

2 REPLIES 2
Anonymous
Not applicable

i have a problem in one measure  when using the divide function ... during the calculation the numerator sometimes is resulting blank.
I tryed to use all the methods bellow but they are all making one chart appearing information in the chart that doesn't bellongs to the selectd filter. how to deal with that?
 
 

Divide handles division by zero error by returning alternate result. However if the numerator is blank then it returns blank.

There are 3 ways to solve this:

  1. COALESCE(DIVIDE(n,d),0)

  2. Use IF to check whether ISBLANK(n) then return 0 otherwise perform the division.

  3. Use +0 - example: DIVIDE(n+0,d)

Which of the above is the most performant and clean approach?

ChielFaber
Solution Specialist
Solution Specialist

It looks like the DAX calculation itself is missing from your post. Could you provide it for? 


[Tip] Keep CALM and DAX on.
[Solved?] Hit “Accept as Solution” and leave a Kudos.
[About] Chiel | SuperUser (2023–2) |

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.