Forum Discussion

Sreya's avatar
Sreya
Icon for Helper II rankHelper II
5 years ago
Solved

How to pass NULL values in IF statement in DAX

It is Solved Now by putting "" or BLANK() in IF statement
  • Why exactly you want NULL values in return from DAX Query?

    If you want to compare NULL values of/from Datasource then the BLANK() function should suffice your needs.

     

    Ref: https://docs.microsoft.com/en-us/dax/blank-function-dax

     

     

    In the original data source, the column evaluated by the BLANK function might have included text, empty strings, or nulls. If the original data source was a SQL Server database, nulls and empty strings are different kinds of data. However, for this operation, an implicit typecast is performed and DAX treats them as the same.

2 Replies

  • FarhanAhmed's avatar
    FarhanAhmed
    Icon for Community Champion rankCommunity Champion

    Why exactly you want NULL values in return from DAX Query?

    If you want to compare NULL values of/from Datasource then the BLANK() function should suffice your needs.

     

    Ref: https://docs.microsoft.com/en-us/dax/blank-function-dax

     

     

    In the original data source, the column evaluated by the BLANK function might have included text, empty strings, or nulls. If the original data source was a SQL Server database, nulls and empty strings are different kinds of data. However, for this operation, an implicit typecast is performed and DAX treats them as the same.

  • v-xuding-msft's avatar
    v-xuding-msft
    Icon for Community Support rankCommunity Support

    Hi Sreya ,

     

    Glad that you have resolved it. Can you please reply your thread again and accept it as solution? Then this thread will be closed. Others who have the same questions will find the solution quickly and benefit from it. Thanks in advance!