Forum Discussion

drrai66's avatar
drrai66
Resolver I
8 years ago
Solved

New Column based upon other two columns

Hi Experts,

Please Help me out on this data.

TypeActionSerial No
FreeGreen1
FreeRed2
PaidRed3
PaidGreen4
FreeGreen5

 

I need a Calculation for a NEW Column on the following Condition:

IF TYPE=FREE and Action=GREEN THEN Serial No END

So if both conditions in 2 columns are Satisfied then New column should return that Serial No, so in this case  the New Column should return 1 & 5 only.

Thanks

Deepak

  • You could do it either in Power Query or DAX.
    I'm guessing DAX will be easier for you:
    If you go to Modeling->New Column and then Write:

    Serial No OK = IF ( [Type] = "Free" && [Action] = "Green", [Serial No] )

    and that should do it.

     

     

    Edit: I should note that the new column in this case will not return only 1 and 5, but also blanks in the rows which do not meet these conditions.

1 Reply

  • Smauro's avatar
    Smauro
    Solution Sage

    You could do it either in Power Query or DAX.
    I'm guessing DAX will be easier for you:
    If you go to Modeling->New Column and then Write:

    Serial No OK = IF ( [Type] = "Free" && [Action] = "Green", [Serial No] )

    and that should do it.

     

     

    Edit: I should note that the new column in this case will not return only 1 and 5, but also blanks in the rows which do not meet these conditions.