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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Why when Numerator is blank does Divide not return the Alternate result?

I thought the key purpose of Divide was to protect against numerator errors and zero division. 

 

On my current report I have blanks (BLANK()) as my Numerator and when this is the case Divide returns BLANK() instead of returning my alternate result 0, why?

 

DivBlank:=DIVIDE(BLANK(), 10 ,0)

#RETURNS BLANK()

 

Is there a way to fix it without putting conditionals in the numerator and denominator to error check for blanks?

 

This is my current solution, but wish it wasn't.

=IF(AND(ISBLANK([MyTrue]),[MyFalse]>0),0,DIVIDE([MyTrue],[myTrue]+[MyFalse],0))
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may add +0 in your formula to avoid using IF condition. Measure =

DIVIDE([MyTrue]+0,[myTrue]+[MyFalse])

For example:

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may add +0 in your formula to avoid using IF condition. Measure =

DIVIDE([MyTrue]+0,[myTrue]+[MyFalse])

For example:

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

That's a great idea

Hi @Anonymous

 

Glad to hear the reply is helpful, please accept the reply as solution, that way, other community members will easily find the solution when they get same issue.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

These two articles attempt at an explanation:

https://docs.microsoft.com/en-us/dax/blank-function-dax

https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models/data-types-supported-ssas-tabu...

 

Basically, blanks are not nulls and are handled differently with DAX compared to Excel.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.