Another option if you want it in the Data Model as in your picture. Assuming data in Excel table tblSource
let
Source = Excel.CurrentWorkbook(){[Name="tblSource"]}[Content],
ChangedTypes = Table.TransformColumnTypes(Source,
{{"#", Int64.Type},{"Member No", Int64.Type},{"Hierarchy", type text},{"Amount", type number}}
),
tblHrchy = Table.TransformColumnTypes(
Table.ExpandListColumn(
Table.TransformColumns(
Table.SelectColumns(ChangedTypes,{"Hierarchy","Amount"}),
{"Hierarchy", each Text.Split(Text.AfterDelimiter(_,"|",Occurrence.First),"|"),
type list
}
),
"Hierarchy"
),
{{"Hierarchy", Int64.Type}}
),
InnerJoin = Table.NestedJoin(ChangedTypes,"Member No", tblHrchy,"Hierarchy", "HrchyAmt"),
AggregMemberAmt = Table.AggregateTableColumn(InnerJoin, "HrchyAmt",
{{"Amount", List.Sum, "MemberAmt", type number}}
)
in
AggregMemberAmt
Then load as Connection + Add to the Data Model