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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors