Hi @Tibbie,
See if this meets your requirement. I’ve referenced your Query so you can paste this into a new blank query in the same file.
let
Source = UnitPriceSegments,
HelperStep = Table.AddColumn(Source, "Temp", each #table( {"Quartile", "Min", "Max"}, {{ List.Skip(Table.ColumnNames(Source), 1), List.Skip(Record.ToList(_),1), List.Skip(Record.ToList(_), 1) }}))[[CategoryID], [Temp]],
ExpandTemp = Table.ExpandTableColumn(HelperStep, "Temp", {"Quartile", "Min", "Max"}, {"Quartile", "Min", "Max"}),
ExpandQuartile = Table.ExpandListColumn(ExpandTemp, "Quartile"),
GetMin = Table.ReplaceValue(ExpandQuartile, each [Min], each [Min]{Number.From( Text.Start([Quartile], 1))-2}, Replacer.ReplaceValue,{"Min"}),
GetMax = Table.ReplaceValue(GetMin, each [Max], each [Max]{Number.From( Text.Start([Quartile], 1))-1}, Replacer.ReplaceValue,{"Max"}),
ChangeType = Table.TransformColumnTypes(GetMax,{{"Quartile", type text}, {"Min", type number}, {"Max", type number}}),
ReplaceErrors = Table.ReplaceErrorValues(ChangeType, {{"Min", 0}})
in
ReplaceErrors
With this result.
I hope this is helpful.