Forum Discussion
Group a table, Concatennate ans sum
- 6 years ago
use measures like this:
Companies = CONCATENATEX( 'Grouping', 'Grouping'[Company],", " ) Products = CONCATENATEX( 'Grouping', 'Grouping'[Product], ", " )Returns this:
- 6 years ago
Hi Anonymous
If you want to do it in Power Query, paste this in a blank query to see the steps:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcvV1dVTSUQpOzCmBUpXO+UCWoYGBUqwOXD4sMy81PbEIwgIrMDaFKHAMcHQGcoNSUxSCE0uTUyFssBITAxQlTkX55XlwRU5FyWA1IGNiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Product = _t, Company = _t, Value = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Product", type text}, {"Company", type text}, {"Value", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Region"}, {{"Product", each Text.Combine([Product], ", "), type text},{"Company", each Text.Combine([Company], ", "), type text}, {"Value", each List.Sum([Value]), type number}}) in #"Grouped Rows"Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
use measures like this:
Companies =
CONCATENATEX(
'Grouping',
'Grouping'[Company],", "
)
Products =
CONCATENATEX(
'Grouping',
'Grouping'[Product], ", "
)
Returns this:
- AlB6 years agoCommunity Champion
Hi Anonymous
If you want to do it in Power Query, paste this in a blank query to see the steps:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcvV1dVTSUQpOzCmBUpXO+UCWoYGBUqwOXD4sMy81PbEIwgIrMDaFKHAMcHQGcoNSUxSCE0uTUyFssBITAxQlTkX55XlwRU5FyWA1IGNiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Product = _t, Company = _t, Value = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Product", type text}, {"Company", type text}, {"Value", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Region"}, {{"Product", each Text.Combine([Product], ", "), type text},{"Company", each Text.Combine([Company], ", "), type text}, {"Value", each List.Sum([Value]), type number}}) in #"Grouped Rows"Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- Anonymous6 years agoNot applicable
This looks great.
Thank you.
Alas I cannot open the pbix as it from a version greater than mine. But I'll try with the formulas anyway (When I learn where to put them)
Gary