cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
darentengdrake
Resolver II
Resolver II

List.Contains() is slow

Hi,

 

I am using = Table.SelectRows(Table1, each List.Contains(List, [UID])) to filter out 300 categories from a table that has 1.6mil rows. However, it is loading very slow when I apply the query whereas the 1.6mil row table has already finished loading. Theorectically, the new table should have less than 1.6mil rows, but why is it taking forever to load? Is there a better way doing it?

 

Thanks!

Daren

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

Hi @darentengdrake

 

Are you using a direct query mode?Why not filter the table in table view?

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

View solution in original post

5 REPLIES 5
ImkeF
Super User
Super User

Hi @darentengdrake  

this could be caused by the list not being buffered.

So whatever step you're referencing with "List", make sure to wrap it into a List.Buffer-function.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

v-kelly-msft
Community Support
Community Support

Hi @darentengdrake

 

Are you using a direct query mode?Why not filter the table in table view?

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

Hi @v-kelly-msft 

 

I am using import mode. I could do the filter in table view using LOOKUPVALUE. Is there a difference between the filter in table view vs query mode in terms of performance and speed?

 

Daren

Hi @darentengdrake

 

If you use M query for calculation,it will only keep the last data after being filtered,and the calculation will be executed in each rows.But if you choose to filter in table view,it wont destroy the data integrity,1.6mil rows of data will still stored in memory and you can first make a filter to pick out the data you need for calculation,no need to execute it in each rows,which will shorten the time for calculation.

However,if it's a need to do a M query,better refer to @ImkeF 's suggestion,this will also help to reduce the time.

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!
Greg_Deckler
Super User
Super User

Likely having to do some kind of table scanning. @ImkeF ?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors