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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sweetie
New Member

DAX Comparison operators

Hi, 

 

I am trying to compare a measure value with null("") through OR condition 

 

Ex:Measure = if(precreatedMeasure1 = "" || precreatedmeasure2 =0, "",sum(columndata)).

 

There is no error in syntax 

But doesn't support for visuals 

It says "DAX COMPARISON OPERATORS DO NOT SUPPORT COMPARING VALUES OF TYPE TEXT" 

(NULL is considered as text here )

can I please find any solution to compare with null values.

1 ACCEPTED SOLUTION

DAX uses BLANK() for database nulls.

You can try above code it will resolve your issue and you can also refer below article.

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

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Can you try below code

Measures =
IF (
OR ( precreatedMeasure1 = BLANK (), precreatedmeasure2 = 0 ),
BLANK (),
SUM ( columndata )
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 ,

 

I was going through 

@https://youtu.be/C26DQkb4hy where in got to know Blank( ) and Null aren't same! 

So do we have any possibilities to compare a value with null.

If we have such It would be really helpful.

 

 

 

DAX uses BLANK() for database nulls.

You can try above code it will resolve your issue and you can also refer below article.

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

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 ,

 

Thanks for your reply, I could understand now that Blank( ) and null aren't same but DAX treats them as same. 

And yes, DAX COMPARISON OPERATORS works fine when comparing with Blank( ).

 

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.