Forum Discussion
Matrix consecutive stepped data
- 6 years ago
Hi edwin
Please consider this solution and leave kudos:-
Add new columns in your query:-
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", type text}, {"Description", type text}, {"Level", Int64.Type}}),
#"Inserted First Characters" = Table.AddColumn(#"Changed Type", "Product group", each Text.Start([Code], 1), type text),
#"Inserted Text Range" = Table.AddColumn(#"Inserted First Characters", "Product category", each Text.Middle([Code], 1, 2), type text),
#"Inserted Text Range1" = Table.AddColumn(#"Inserted Text Range", "Product subcat", each Text.Middle([Code], 3, 2), type text),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Text Range1",{{"Code", "Product code"}})
in
#"Renamed Columns"
Create a hierarchy with:-
Product group (character 1)
Product category (character 2-3)
Product subcategory (character 4-5)
Product code (character 1-8)
Drag the hierarchy to the matrix and use +/- to expand and collapse each level
Click here to download example
Hi edwin
Please consider this solution and leave kudos:-
Add new columns in your query:-
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", type text}, {"Description", type text}, {"Level", Int64.Type}}),
#"Inserted First Characters" = Table.AddColumn(#"Changed Type", "Product group", each Text.Start([Code], 1), type text),
#"Inserted Text Range" = Table.AddColumn(#"Inserted First Characters", "Product category", each Text.Middle([Code], 1, 2), type text),
#"Inserted Text Range1" = Table.AddColumn(#"Inserted Text Range", "Product subcat", each Text.Middle([Code], 3, 2), type text),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Text Range1",{{"Code", "Product code"}})
in
#"Renamed Columns"
Create a hierarchy with:-
Product group (character 1)
Product category (character 2-3)
Product subcategory (character 4-5)
Product code (character 1-8)
Drag the hierarchy to the matrix and use +/- to expand and collapse each level
Click here to download example
- edwinb6 years agoFrequent Visitor