Forum Discussion

Jun_Wang's avatar
Jun_Wang
Advocate I
7 years ago
Solved

IF statement in DAX

Could you please help write one DAX formular (calculated column)?

 

The desired output is like this:

If Column A is blank, the newly addedColumn = the value in the Column B, otherwise return the value in Column A

 

Both type of column A and B are text.

 

Many thanks

Jun

  • Hi Jun_Wang 

    You can use expression below.

    Column = 
    IF( 
        YourTable[Column A] = BLANK(), 
        YourTable[Column B], 
        YourTable[Column A]  
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski



2 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Jun_Wang 

    You can use expression below.

    Column = 
    IF( 
        YourTable[Column A] = BLANK(), 
        YourTable[Column B], 
        YourTable[Column A]  
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski