Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

How to handle NULL value in custom column

HI,

I need to to convert the below expression to power BI supported expression when I am going to add new column :

 

if(not isNULL(DOC_RECORD_KEY), DOC_RECORD_KEY,
if(not isNULL(MSG_RECORD_KEY), MSG_RECORD_KEY, GATEWAY_RECORD_KEY)
) as TRANSACTION_RECORD_KEY

 

Can anyone tell me the correct syntax for it?

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    I am using the below code:

    if ([DOC_RECORD_KEY] <> "NULL", [DOC_RECORD_KEY],
    if([DOC_RECORD_KEY] <> "NULL", [DOC_RECORD_KEY], [GATEWAY_RECORD_KEY]
    )
    )

    but getting 'Token RightParen Expected' error. So please correct me in this case.

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

      Hi Anonymous

       

      You may refer to below DAX.  If it is not your case, please share your data sample and expected output.

      Column =
      IF (
          Table[DOC_RECORD_KEY] <> BLANK (),
          Table[DOC_RECORD_KEY],
          Table[GATEWAY_RECORD_KEY]
      )

       

      Regards,

      Cherie

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        I am using the below DAX expression:

        TRANSACTION_RECORD_KEY = if([DOC_RECORD_KEY] <> BLANK(),[DOC_RECORD_KEY], if([MSG_RECORD_KEY] <> BLANK(), [MSG_RECORD_KEY], [GATEWAY_RECORD_KEY]))

         

        but getting the below error:

         

        Argument '3' in IF function is required.

         

        Please correct the above syntax.