Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Dax

In the above picture, I want to replace NaN and infinity wth string "Not Applicable". What will be the Dax?

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Anonymous  ,

    Here are the steps you can follow:

    1. Create calculated column.

    new =
    IF(
        [OldResult] in {1/0,0/0},
        "Not Applicable",[OldResult]&"")

     2. Result.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Anonymous , Prefer to use divide and return blank() ,

     

    Divide([Column1], [column2], blank())

     

    Because "Not Applicable" is a text and the rest are numbers, the mixed data type is not allowed

     

    if([column2] =0, "Not Applicable", [Column1]/[Column2] & "")

    • Anonymous's avatar
      Anonymous
      Not applicable

      It is possible with if function in Power Query.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous  ,

    Here are the steps you can follow:

    1. Create calculated column.

    new =
    IF(
        [OldResult] in {1/0,0/0},
        "Not Applicable",[OldResult]&"")

     2. Result.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.