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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -