Forum Discussion

hongho2's avatar
hongho2
Frequent Visitor
2 years ago
Solved

syntax

Hi,

For the syntax below, I want to set Staged column to Yes when status >15 else  No . However,I also want to set to No if  status is null or blank,  but don't know the syntax.  Can you assist ?

 

Staged = if(Number.FromText([#"Warehousing [Status]"]))>15 then "Yes" else "No"

 

  • Hi hongho2 , this should work:

     

    if Number.FromText([Status]) <= 15 or List.Contains({null, ""}, [Status]) then "No" else "Yes"

6 Replies

  • Hi hongho2 , this should work:

     

    if Number.FromText([Status]) <= 15 or List.Contains({null, ""}, [Status]) then "No" else "Yes"
    • hongho2's avatar
      hongho2
      Frequent Visitor

      Thank you for your reply, but it did not work. I filtered for blanks,  It should show "No." from the status instead of nothing.

       

       

       

      • hnguy71's avatar
        hnguy71
        Super User

        Hi hongho2 ,

         

        Is this PowerQuery or DAX? If it didn't work in PowerQuery it should have given you an error message. Can you share me the error message?

         

        Perhaps you can share a bit more information on how you're getting blanks? You're connecting to another table via merge, append, or a relationship?

  • hongho2's avatar
    hongho2
    Frequent Visitor

    it merged with other table, but the filter is in the same table.