Forum Discussion
quinnjohnson
1 year agoHelper I
Aggregate table where a singular value from one column has multiple values in a second column
Hello, I am wondering if it is possible to reorganize a table visual through some sort of method as follows; The current table looks like this when I add the data to the table visual; ...
- 1 year ago
quinnjohnson
Here is a Power Query solution if you like:let Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content], #"Grouped Rows" = Table.Group(Source, {"Company Name"}, {{"Detail", each Table.TransformColumns( Table.AddIndexColumn(_,"i",1,1),{"i", each "Group" & Text.From(_)} ) }}), Custom1 = Table.Combine(#"Grouped Rows"[Detail]), #"Pivoted Column" = Table.Pivot(Custom1, List.Distinct(Custom1[i]), "i", "Group", List.Sum) in #"Pivoted Column"
Fowmy
1 year agoSuper User
quinnjohnson
Here is a Power Query solution if you like:
let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Company Name"}, {{"Detail", each Table.TransformColumns( Table.AddIndexColumn(_,"i",1,1),{"i", each "Group" & Text.From(_)} ) }}),
Custom1 = Table.Combine(#"Grouped Rows"[Detail]),
#"Pivoted Column" = Table.Pivot(Custom1, List.Distinct(Custom1[i]), "i", "Group", List.Sum)
in
#"Pivoted Column"
quinnjohnson
1 year agoHelper I
Thank you! That is exactly what i need, i am just struggling on where exactly i type these lines of code at? i have barely worked with this type of coding within Power BI.