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

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

Reply
DeonDP
Helper II
Helper II

Index Match in Power Query - M Code (for a MS Excel Brain)

Hi All

 

This is my very first contribution type post on the forum - so please be kind and bear with me if I made a mistake somewhere.

 

Just thought I'd make this post to save someone (new to Power BI like me) some time to figure out how to make the MS Excel Index/Match formula work in Power Query editor without using the Merge function.  I am using the Create a Custom column function to do this.

 

I got the initial code from this forum - cannot remember which post it was & it was before I even was a registered member.  Many thanks to whoever posted it, but I still had to figure out how everything links together since I am a newbie to M Code.  There were also some other bits and pieces I had to figure out to make it work for me.

 

There could also be other coding or DAX formulas that will do the job, but this is just one take on it that worked for me.

 

If it helps you - great!!  If there is an error in it somewhere, please let me know.  Just remember - this is how it made sense to my brain :-).

 

If there is a better way to do it - PLEASE reply and let me know.  I am hooked on Power BI and enjoying the journey.

 

 

DeonDP_0-1606435535449.png

 

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @DeonDP 

 

this is how a INDEX/MATCH in power query looks like in power query. However, I think it's better to join tables and then extract the first finding (the same as INDEX/MATCH is doing) because of performance issues, especially when tables are big.

 

Hope this helps

 

Jimmy

View solution in original post

2 REPLIES 2
DeonDP
Helper II
Helper II

Thank you for your reply @Jimmy801 

 

As I mentioned, I am on a learning journey with Power Query & Power BI.  A journey that I think will probably continue way into the future.  The only reason for my post is to share in a little more detail, than what is doing the rounds , of how it is possible to do Index Match in Power Query.  If for no reason other than coming to the conclusion (for an Excel brain 🙂 ) in a similar position than me that joining tables could be a more efficient way to go.  I am working with rather big tables, and everything is just super slow to apply when I make a change in Power Query, so I think I will try to join more and lookup less.

 

Thanks again for your response.

 

DeonDP

Jimmy801
Community Champion
Community Champion

Hello @DeonDP 

 

this is how a INDEX/MATCH in power query looks like in power query. However, I think it's better to join tables and then extract the first finding (the same as INDEX/MATCH is doing) because of performance issues, especially when tables are big.

 

Hope this helps

 

Jimmy

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.