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
DSR
Resolver I
Resolver I

How to refer to previous step in Custom Function when it is in subtable

Hello, your help please,
 
in creating and using the Custom Function the PreviousStep is "Col.IndexSub" which is inside "FullTable" I want to access it when invoking the Function on the left, but the box shows queries outside.How to refer to previous step in Custom Function.png

3 REPLIES 3
DSR
Resolver I
Resolver I

How to refer to previous step in Custom Function.png

How to refer to previous step in Custom Function Code.png

See how you have nested "each"  ?  That's asking for trouble.  The Power Query engine can be confused and grab data from the wrong context. Use function notation instead.

lbendlin
Super User
Super User

Learn about scope - the Power Query equivalent of context.  You can use function notation instead of "each"  to clearly identify your context layers and address items in each.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.