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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.