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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chunkysoup
Frequent Visitor

New to PowerBI & DAX - Can't determine how to compare two columns in different tables to find values

 Hello,

I apologize if this is a simple question but I am not an EXCEL expert and being new to PowerBI and DAX I am unsure how to get what I am looking for. I have two tables. In table 1 I have a list of parts that will be obsoleted. In Table 2 I have a column where those parts have been specified by clients. I have used Table 1 to filter table 2 in PowerBI so we can see who ordered what and communicate to them the parts are going away. That was easy. That was step one but what I want to do is create a new list that filters table 1 to show the parts in that table that are not in the column of table 2. I want to see what is NOT being ordered so we can rid those components immediately. I have tried IF statements, NOT(CONTAINS( statements and others to even less success but the main issue I run into is that all these comparisons look for a single value to filter on. I found a couple promising examples in the forums but they always seem to filter by a specific value. Full disclosure...my real Table 1 is 400 rows and Table 2 is over 150,000 rows. Also, the column I am searching in in Table 2 has 9 other columns that the value could also be in. I cannot change that as it is how our products are configured. While there are not 150,000 unique records in that Table 2 column there could be up to 2000 unique codes.

 

I don't want to have to create 400 different measures to compare and I am positive I don't have to but I am racking my brain trying to figure this out. I can't show the actual data because it is huge but also confidential. Below is a cheap and dirty mockup of what I am looking to do. If I can get it to do it on one column I know I can append to the measure to check the other columns as well.

Again I apologize for what may seem like a simple problem to you. 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @chunkysoup,

 

I made one sample for your reference. We need to create a calculated column based on Table1.

 

result =
IF (
    LOOKUPVALUE ( Table2[bbb], Table2[bbb], Table1[aaa] ) <> BLANK (),
    BLANK (),
    Table1[aaa]
)

For more details, please check the pbix as attached.

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @chunkysoup,

 

I made one sample for your reference. We need to create a calculated column based on Table1.

 

result =
IF (
    LOOKUPVALUE ( Table2[bbb], Table2[bbb], Table1[aaa] ) <> BLANK (),
    BLANK (),
    Table1[aaa]
)

For more details, please check the pbix as attached.

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Frank,

Thank you so much as this worked brilliantly!

Ashish_Mathur
Super User
Super User

Hi,

 

Share a dummy dataset and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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