Forum Discussion

Sweetie's avatar
Sweetie
New Member
5 years ago
Solved

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.

4 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Can you try below code

    Measures =
    IF (
    OR ( precreatedMeasure1 = BLANK (), precreatedmeasure2 = 0 ),
    BLANK (),
    SUM ( columndata )
    )
    • Sweetie's avatar
      Sweetie
      New Member

      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.