The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to 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
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( ).
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |