Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

If statement stops working if I switch true and false

I currently have the following statement which works:

 

Measure2 = If([Measure] <= 0,5;[Measure];"")

 

However, I want the value for 'true' to be blank, and for false to be [measure]. 

 

When I change this in my measure, it gives only blanks. And more, all values in my table are suddenly blank. 

 

I cannot see what I do wrong here though, and why it would be able to show this correctly but not when I switch the true and false.

  • Anonymous,

     

    Please try the expression below.

    Measure2 = If([Measure] <= 0,5,BLANK(),[Measure])

     

    If the issue persists, please provide us more information about your report, so that we can make further analysis. You can upload a pbix file to Onedrive or any web storage and share the link. Do mask sensitive data before uploading.

     

    Regards,

    Charlie Liao

3 Replies

  • v-caliao-msft's avatar
    v-caliao-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Anonymous,

     

    Please try the expression below.

    Measure2 = If([Measure] <= 0,5,BLANK(),[Measure])

     

    If the issue persists, please provide us more information about your report, so that we can make further analysis. You can upload a pbix file to Onedrive or any web storage and share the link. Do mask sensitive data before uploading.

     

    Regards,

    Charlie Liao

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, that works for me! :) 

  • Anonymous's avatar
    Anonymous
    Not applicable

    I currently have the following statement which works:

     

    Measure2 = If([Measure] <= 0,5;[Measure];"")

     

    However, I want the value for 'true' to be blank, and for false to be [measure]. 

     

    When I change this in my measure, it gives only blanks. And more, all values in my table are suddenly blank. 

     

    I cannot see what I do wrong here though, and why it would be able to show this correctly but not when I switch the true and false.