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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How to compare the values in entire column with other values in another table?

Hi all,

sw40_3-1607999353677.png

 

I have two tables, Table A and Table B. I want to get the product names (highlighted) in Table B based on the price. This can be done easily in Excel using IF function (as shown in the screenshot above). However, I'm not sure how to do it in PowerBI. I want to fix the formula for the Product column in Table B which means I don't need to change the formula in future. So let say if I changed the name for Product A to Product C and Product B to Product D in Table A, the product names in Table B will change as well, i.e., the product names in Table B is purely based on how we define it in Table A.

 

I'm not sure how to do it in PowerBI using DAX formula since the number of row for two tables are different. Hope to get some advise from you guys, thank you!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,Try a new column like

new column = maxx(filter(TableA, TableA[price] = TableB[Price]), TableA[Product])

Refer log - https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,Try a new column like

new column = maxx(filter(TableA, TableA[price] = TableB[Price]), TableA[Product])

Refer log - https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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