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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ooptennoort
Advocate I
Advocate I

Extract same range multiple times out of 1 table into multiple (sub)tables

I need to split a table into a range everytime Table.PositionOf finds the "Marker word". It works when using only 1 Occurence (.First or .Last) but .All produces more than 1 number in the list and Table.Range cannot deal with this.

= Table.Range(Source,(Table.PositionOf(Source,[Column1="Marker word"],Occurrence.All,"Column1")),5)

In other words, how do I get Table.Range to work on each number in a list of more than one number???? Or rather, how do I "convert a value of type List to type Number" in this context i.e. producing multiple ranges (ideally appended)?

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Hello, @ooptennoort try this:

positions = List.Buffer(Table.PositionOf(Source,[Column1="Marker word"],Occurrence.All,"Column1")),
ranges = Table.Combine( List.Transform(positions, each Table.Range(Source, _, 5)) )

 

View solution in original post

2 REPLIES 2
ooptennoort
Advocate I
Advocate I

Wow, such simplicity and without any recursive functions! Amazing. Thank you so much!!!

AlienSx
Super User
Super User

Hello, @ooptennoort try this:

positions = List.Buffer(Table.PositionOf(Source,[Column1="Marker word"],Occurrence.All,"Column1")),
ranges = Table.Combine( List.Transform(positions, each Table.Range(Source, _, 5)) )

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Kudoed Authors