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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.