Thanks @Brian for the challenge.

Here is my solution.

**1. Using Two Way Lookup**

```
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
GroupedRows = Table.Group(Source, {"Category"}, {{"Count", each _, type table [Category=text, Value=number]}}),
AddedCustom = Table.RemoveColumns(Table.AddColumn(GroupedRows, "Custom", each Table.AddIndexColumn([Count],"Index",0,1)),{"Category","Count"}),
ExpandedCustom = Table.ExpandTableColumn(AddedCustom, "Custom", {"Category", "Value", "Index"}, {"Category", "Value", "Index"}),
AddedIndex = Table.AddIndexColumn(ExpandedCustom, "Index.1", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(AddedIndex, "Custom", each if [Index] = 0 then null else AddedIndex{[Index.1]-1}[Value]),
RemovedColumns = Table.RemoveColumns(#"Added Custom",{"Index", "Index.1"}),
RenamedColumns = Table.RenameColumns(RemovedColumns,{{"Custom", "Previous Value"}})
in
RenamedColumns
```

**2. Using Self Join**

```
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
GroupedRows = Table.Group(Source, {"Category"}, {{"Count", each _, type table [Category=text, Value=number]}}),
AddedFirstIndex = Table.SelectColumns(Table.AddColumn(GroupedRows, "AddedFirstIndex", each Table.AddIndexColumn([Count],"Index",0,1)),{"AddedFirstIndex"}),
ExpandColumns = Table.ExpandTableColumn(AddedFirstIndex, "AddedFirstIndex", {"Category", "Value", "Index"}, {"Category", "Value", "Index"}),
AddedSecondIndex = Table.AddIndexColumn(ExpandColumns, "Index1", 0, 1, Int64.Type),
AddedThirdIndex = Table.AddIndexColumn(AddedSecondIndex, "Index.1", 1, 1, Int64.Type),
MergeQueries = Table.NestedJoin(AddedThirdIndex, {"Index1"}, AddedThirdIndex, {"Index.1"}, "Added Index1", JoinKind.LeftOuter),
MultipleCodes = Table.TransformColumnTypes(Table.RenameColumns(Table.RemoveColumns(Table.Sort(Table.ExpandTableColumn(MergeQueries, "Added Index1", {"Value"}, {"Value.1"}),{{"Index.1", Order.Ascending}}),{"Index1","Index.1"}),{"Value.1","Unadjusted Value"}),{{"Category",type text},{"Value", Int64.Type},{"Unadjusted Value", Int64.Type}}),
AddedCustom = Table.AddColumn(MultipleCodes, "Custom", each if [Index] = 0 then null else [Unadjusted Value]),
RemovedColumns = Table.RemoveColumns(AddedCustom,{"Unadjusted Value", "Index"}),
RenamedColumns = Table.RenameColumns(RemovedColumns,{{"Custom", "Previous Value"}}),
ChangedType = Table.TransformColumnTypes(RenamedColumns,{{"Previous Value", Int64.Type}})
in
ChangedType
```

Power Query Challenge - Refer Preview Row for Subgroup.xlsx (46.2 KB)