let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Typed = Table.TransformColumnTypes(Source,{{"NAME", type text}, {"REPT", Int64.Type}}),
Repeated = Table.TransformColumns(Typed, {"REPT", each List.Numbers(_,_,0), type list}),
Expanded = Table.ExpandListColumn(Repeated, "REPT"),
#"Removed Columns" = Table.RemoveColumns(Expanded,{"REPT"})
in
#"Removed Columns"
Hi,
Power Query Solution:
Code:let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], Typed = Table.TransformColumnTypes(Source,{{"NAME", type text}, {"REPT", Int64.Type}}), Repeated = Table.TransformColumns(Typed, {"REPT", each List.Numbers(_,_,0), type list}), Expanded = Table.ExpandListColumn(Repeated, "REPT"), #"Removed Columns" = Table.RemoveColumns(Expanded,{"REPT"}) in #"Removed Columns"
Regards,
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
ChangeType = Table.TransformColumnTypes(Source,{{"NAME", type text}, {"REPT", Int64.Type}}),
MakeListRepeat = Table.AddColumn(ChangeType, "List", each List.Repeat({[NAME]},[REPT])),
ExpandList = Table.ExpandListColumn(MakeListRepeat, "List"),
RemoveOtherCols = Table.SelectColumns(ExpandList,{"List"})
in
RemoveOtherCols
There is an alternative, in my eyes more readable, way via PQ...
Add a column with this formula: List.Repeat({[NAME]},[REPT])