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
Anonymous
Not applicable

Look up in power query based off conditions

Hello,

 

Is it possible to do a look up in power query based off a condition?

 

for example I have a table I want to join in power query joining on [customer_id] but I want to add a condition: 

 

Join on [customer_id] when [islatest] = 1

 

Is this possible?

 

Thank you!

1 ACCEPTED SOLUTION

If you duplicate the second table then merge it into the first (not creating a new table) and then disable the load (right click on the query in the editor and uncheck enable load) then your model will end with two tables as you wanted and won't load any extra data in, which might help you keep your model nice and clean!

 

Hope that has helped you!

View solution in original post

7 REPLIES 7
Bizualisation
Resolver I
Resolver I

Hiya - might help if you post some sample data?

 

Just from what you've posted, you could try filtering the second table to only show [islatest] to 1, then merging them?

 

If you still needed the second table with all items, you could duplicate the table, then filter it and merge on that, to preserve the original, unfiltered table in your data model.

Anonymous
Not applicable

I do still need the second table not to be filtered. i have thought of duplicating the table and merging as well but I wanted to make sure there was not another way 

In PowerBI there are usually multiple ways to any solution but I think duplicating and merging would probably be the easiest approach - is there a reason you would like to avoid using that technique?

Anonymous
Not applicable

@Bizualisation no reason other then I wanted to keep it as clean as possible, but I will use that method then 

Anonymous
Not applicable

@amitchandak  thank you!

If you duplicate the second table then merge it into the first (not creating a new table) and then disable the load (right click on the query in the editor and uncheck enable load) then your model will end with two tables as you wanted and won't load any extra data in, which might help you keep your model nice and clean!

 

Hope that has helped you!

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.