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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
luigiPulido_
New Member

Filter all records from an order if the order contain one specific product

Hello there,

 

The business problem is that I download a table from shopify where I have the order with all the items that are in that order. The problem is that  orders that has (in this case) the Product 'bbbb' need to be handle different with all  the products in that order.

 

In this case this the comple table

luigiPulido__0-1699983351172.png

And this is the table that I need at the end where only order 1 and 4 has product 'bbbb'

luigiPulido__1-1699984128484.png

 

I tried with data nesting and some filters but to be honest I am not very good with powerquery and M lenguage. My plan B is Macros or Array formulas in Excel but I prefer to  learn something new with power query.

 

 

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Hello, @luigiPulido_ 

let
    Source = your_table,
    orders = Table.SelectRows(Source, (x) => x[Product] = "bbbb")[Order],
    z = Table.SelectRows(Source, (x) => List.Contains(orders, x[Order]))
in
    z

View solution in original post

4 REPLIES 4
ReportGuru
Post Patron
Post Patron

Hi @luigiPulido_ were you able to find a solution? As a workaround, maybe you can try to test your connection with a 3rd party connector. I've tried windsor.ai, supemetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the Shopify connector in the data sources list:

 

SALESFORCE-1.png

 

After that, you need to follow instructions and install the windsor.ai app from the Shopify App Store:

 

SHOPIFY-1.5.png

 

then on preview and destination page you will see a preview of your Shopify fields

 

SHOPIFY-2.jpg

 

There just select the fields you need. Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url.

 

SELECT_DESTINATION_NEW.png

AlienSx
Super User
Super User

Hello, @luigiPulido_ 

let
    Source = your_table,
    orders = Table.SelectRows(Source, (x) => x[Product] = "bbbb")[Order],
    z = Table.SelectRows(Source, (x) => List.Contains(orders, x[Order]))
in
    z

Yes, thats exactly what I was looking for. Thanks, I just need to understand whats going on LOL

@luigiPulido_ well, first Table.SelectRows gives you all rows that contain "bbbb" in Product column. Little touch of [Order] after closing bracket gives us a list of order numbers in that table. You may clearly see this list in PQ editor. Then (step z) we filter original tables' orders column. That is all about Table.SelectRows, columns as lists of items, working with lists functions etc. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors