Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Result based on 2 columns

Hi,

I need to create a custom  Categeory = "BA" and "Place" ="" then "BA" else "".

 

  • Anonymous , Try a new column like

     

    if(not(isblank([Categeory])) && isblank([Place]), [Categeory], blank())

     

    Based on highlighted column

  • Anonymous 

     

    In Power Query, you would create a custom column as follows:

     

    requiredColumn =
    if [Categeory] <> null and [Place] = null then [Categeory] else null

     

     

    amitchandak has already provided the best DAX solution.

     

    Pete

3 Replies

  • Anonymous , Try a new column like

     

    if(not(isblank([Categeory])) && isblank([Place]), [Categeory], blank())

     

    Based on highlighted column

  • Anonymous 

     

    In Power Query, you would create a custom column as follows:

     

    requiredColumn =
    if [Categeory] <> null and [Place] = null then [Categeory] else null

     

     

    amitchandak has already provided the best DAX solution.

     

    Pete

  • FrankAT's avatar
    FrankAT
    Community Champion

    Hi Anonymous ,

    you can do it like this:

     

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)