powerquery - Arranging Data in a Query Table -


i'm trying figure out simple way (using powerquery) convert this:

enter image description here

into this:

![enter image description here

i've spent days trying figure out simple way it.

everything i've tried has failed.

you can use group on transform tab, group project , define aggregation each of segment columns (e.g. sum). adjust created code list.sum list.removenulls. add column nested tables segment columns, using table.fromcolumns. remove original segment columns , expand nested tables.

let     source = excel.currentworkbook(){[name="table1"]}[content],     #"changed type" = table.transformcolumntypes(source,{{"project", type text}, {"segment1", type text}, {"segment2", type text}, {"segment3", type text}}),     #"grouped rows" = table.group(#"changed type", {"project"}, {{"segment1", each list.removenulls([segment1]), type text}, {"segment2", each list.removenulls([segment2]), type text}, {"segment3", each list.removenulls([segment3]), type text}}),     #"added custom" = table.addcolumn(#"grouped rows", "tabled", each table.fromcolumns({[segment1],[segment2],[segment3]},{"segment1","segment2","segment3"})),     #"removed columns" = table.removecolumns(#"added custom",{"segment1", "segment2", "segment3"}),     #"expanded tabled" = table.expandtablecolumn(#"removed columns", "tabled", {"segment1", "segment2", "segment3"}, {"segment1", "segment2", "segment3"}) in     #"expanded tabled" 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -