Forum Discussion

Anya_T's avatar
Anya_T
Frequent Visitor
5 years ago
Solved

Column Condition

Hi,

 

I have data in two column. I want to compare them and make a new column as per condition. Please find below the data of 2 column

 

User IDClassifier
aa
bnull
cc
df
enull

my expected output is

expected Column result
a
b
c
null
e

 

condition are if values of User ID is equal to Classifier column(same or null) should print value of User ID in expected Column result else they should be null.

2 Replies

  • Anya_T maybe even a simple version:

     

     

    Column = 
     IF (
        YourTable[User ID] = YourTable[Classifier] || ISBLANK ( YourTable[Classifier] ), 
        YourTable[User ID]
      )

     

     

    ✨ Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    ⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anya_T Perhaps:

    Column = 
      SWITCH(TRUE(),
        [User ID] = [Classifier] || ISBLANK([Classifier],[User ID],
        BLANK()
      )