Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AdityaG
Helper I
Helper I

DAX for finding if a particular item in a column is present in a separate list or not

Col 1Col 2Col 3Output
apple bananaapple
orange appleERROR
grapestomatopotatotomato
banana tomatobanana
papayapotato potato

 

Here, column 1 represents the list of items. Column 2 represents corrected list of items from Column 1 (the ones that are blank do not need any correction). Column 3 is the "separate list".

Column 4 is the output -> if column 2 has corrections listed, output should be column 2. If no corrections are there in column 2 against column 1 item then check if the item in column 1 is in column 3. If it's present then output would be the item in column 1, if not then output is ERROR.

 

Please help in creating the DAX for this. Thanks.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @AdityaG 

Please try Calculated Column

Ouput =
IF (
ISBLANK ( 'Table'[Column2] ),
IF (
'Table'[Column1] IN VALUES ( 'Table'[Column3] ),
'Table'[Column1],
"ERROR"
),
'Table'[Column2]
)

 

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @AdityaG 

Please try Calculated Column

Ouput =
IF (
ISBLANK ( 'Table'[Column2] ),
IF (
'Table'[Column1] IN VALUES ( 'Table'[Column3] ),
'Table'[Column1],
"ERROR"
),
'Table'[Column2]
)

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors