Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello.
I have a 'Product' table, it has a 'Product Code' column and multiple attribute columns. It is an enormous data-set, as it has all the product a company as produced in its history.
In addition, I have an 'Inventory' table and a 'Sales' table. These also have a 'Product Code' column.
In order to reduce my query size, I want to query only the 'Product Codes' in the 'Product' table that appear in both the 'Inventory' and 'Sales' tables.
How do I do this?
I've started with something like this, but it's not working, I may be way off:
= Table.SelectRows(#"Product", each List.Contains(Table.Column(#"Inventory", "Product Code"), [Product Code]) and List.Contains(Table.Column(#"Sales", "Product Code"), [Product Code]))
Alternatively, maybe I can do a sort of lookup column where if Product Code appears in 'Inventory' and 'Sales', mark an "X", and then query only rows that contain an "X"? But I haven't figured out the code for that route.
Thank you!
Thanks, @HotChilli
I'm very new to writing this kind of code. Do you have an example of how I would need to type that in?
Maybe use List.Intersect to create a list of product codes in Inventory and Sales tables.
Then use Table.SelectRows on the Product table with List.Contains passing the list you created and the Product code.
--
I advise reducing your tables to a few rows to use as a test when writing the code
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |