Forum Discussion
DanFromMontreal
Helper IV
2 years agoConsolidating all Measures by Project
Hello dear community, I'm trying to use PowerQuery to group all my "Measure" that are in different rows by "Projet. My table has 2 columns Project Measure P1 A P1 ...
- 2 years ago
Hi DanFromMontreal,
See if you can apply the below code to your scenario.
let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText("i45WCjBU0lFyVIrVgTKdEExnCNMIIWqMEAUxXZRiYwE=", BinaryEncoding.Base64), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, Measure = _t] ), GroupedRows = Table.Group( Source, {"Project"}, {{"all", each _, type table [Project = nullable text, Measure = nullable text]}} ), Custom1 = Table.AggregateTableColumn( GroupedRows, "all", {{"Measure", each Text.Combine(List.Transform(_, Text.From), ","), "Measure"}} ) in Custom1
KNP
Super User
2 years agoHi DanFromMontreal,
See if you can apply the below code to your scenario.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WCjBU0lFyVIrVgTKdEExnCNMIIWqMEAUxXZRiYwE=", BinaryEncoding.Base64),
Compression.Deflate
)
),
let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, Measure = _t]
),
GroupedRows = Table.Group(
Source,
{"Project"},
{{"all", each _, type table [Project = nullable text, Measure = nullable text]}}
),
Custom1 = Table.AggregateTableColumn(
GroupedRows,
"all",
{{"Measure", each Text.Combine(List.Transform(_, Text.From), ","), "Measure"}}
)
in
Custom1
DanFromMontreal
Helper IV
2 years agoThank you sooooo much KNP.
Does the trick.
I'll need to investigate how to created your JSON file. Sweet 😉
- KNP2 years ago
Super User
You're welcome.
The JSON code in the source step is the result of copy/paste data into the 'Enter data' section in Power Query.