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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors