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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
MS1986
Regular Visitor

Query slows down after using Table.First Power Query

Hi All,

 

I'm new to the Forum so sorry if this is posted in a wrong place.

 

I tried to find a solution on Google, but unfortunately, it seems that no one has stumbled upon a similar issue. 

 

I started using Power Query only recently, so I'm still learning. Anyway, I am trying to build an automated reporting for vendor expense map for my company. I have 4 data source files which are transformed and merged into one query with mappings applied. 

 

Problem starts when I try to Merge my Left Table with a mapping table which contains duplicates. In order to avoid duplicated lines (which is not expected for a final result) I use Table.First function and then the issue starts. Up until the function, everything works smoothly. When I apply the function a whole query slows down and takes ages to calculate. Any ideas on how to fix this would be much appreciated.

 

 

1 ACCEPTED SOLUTION

Thank you very much! I did exactly this last night trying to figure out the way. This helped and now the query works way smoother, I also included Table.Buffer for all  source tables and switched off the backroundupdates for queries. Now extracting 180k records takes approx 3-5mins. 

 

 

View solution in original post

3 REPLIES 3
ImkeF
Community Champion
Community Champion

Remove the duplicates from your (right) lookup-table before merging it: Faster merge and no need to select first values afterwards.

(Create an intermediate table if you need the lookup-table in its original state in the data model)

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

Thank you very much! I did exactly this last night trying to figure out the way. This helped and now the query works way smoother, I also included Table.Buffer for all  source tables and switched off the backroundupdates for queries. Now extracting 180k records takes approx 3-5mins. 

 

 

ImkeF
Community Champion
Community Champion

Good to hear! 

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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