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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Vestments7
Regular Visitor

VLOOKUP OR INDEXMATCH ALTERNATIVE TO FIND VALUE BASED ON CELL VALUE

This is what I have:

 

IDName
1 
1 
1A
2 
2B
2 
3 
3 
3 
3C

 

And this is what I need:

IDName
1A
1 
1 
2B
2 
2 
3C
3 
3 
3 

 

Which formula is the best in the PowerQuery M environment if it's same table? I have tried FIRSTNONBLANK function and I got an error. Then I tried LOOKUPVALUE and also got an error. I am confused about what is wrong? How to sort/lookup properly based on ID value?

4 REPLIES 4
serpiva64
Solution Sage
Solution Sage

Hi,

you can obtain

serpiva64_0-1676846683323.png

by grouping 

serpiva64_1-1676846713363.png

then adding a nested index column

serpiva64_2-1676846758457.png

expanding

serpiva64_3-1676846812203.png

and finally adding a conditional column

serpiva64_4-1676846845834.png

You can see the steps in the attached file

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

 

Cool and thanks for your answer. But this is not I am looking for as this in DAX environment. But how to do that using PowerPivot (PowerQuery M) that is built in Excel? There is no Group by feature and also no Table.AddIndexColumn formula.

 
 
 
 
 

Hi,

Here is the project in excel.

the commands between BI and excel a quite the same

serpiva64_0-1676883682968.png

 

Thank you for your message. You are using Query, but mine is loaded as Data Model and use PowerPivot. How to do that using Data Model? There is no much feature to operate and find the solution. 

 
 
 
 
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors