Skip to content

Instantly share code, notes, and snippets.

@cbaragao
Created October 31, 2025 16:43
Show Gist options
  • Select an option

  • Save cbaragao/e3897eb47525b25f14ad279cf263b2a5 to your computer and use it in GitHub Desktop.

Select an option

Save cbaragao/e3897eb47525b25f14ad279cf263b2a5 to your computer and use it in GitHub Desktop.
(l as list, selections as list)=>
let
Source =
List.Accumulate(
selections,
{},
(state,current)=>
if
Text.Contains(current,":")
then
List.Combine({state,
List.Range(
l,
List.PositionOf(l,
Text.Split(
current
,":"
){0}
), List.PositionOf(l,
Text.Split(
current
,":"
){1}
) - List.PositionOf(l,
Text.Split(
current
,":"
){0}
)+1
)}) else List.Combine({state,{List.Select(l, each _ = current){0}}})
)
in
Source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment