Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Is there a way to combine text values in multiple rows based on the value in another column in the Query editor? For example, I have the following table:
Column 1 Column 2
03-02 5.6.1.1.22
03-02 5.7.1.1.11
03-02 5.6.7.1.15
What I am trying to achieve is the following:
Column 1 Column 2
03-02 5.6.1.1.22; 5.7.1.11; 5.6.7.1.15
Using the group function doesn't work for this.
I can to this with a measure using the Concatenaex and Value functions however I need the table in the Query editor insteat.
Many thanks.
Solved! Go to Solution.
@elinady Please try this as a "New Table"
Test152Out = SUMMARIZE(Test152GroupConcat,Test152GroupConcat[Column1],"Result",CONCATENATEX(Test152GroupConcat,Test152GroupConcat[Column2],";"))
In Power Query, please try this..
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDWNTBS0lEy1TPTMwRCIyOlWB1kYXOwsKEhmrAZRMJUKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Grouped", each Text.Combine([Column2],";"), type text}}) in #"Grouped Rows"
Proud to be a PBI Community Champion
@elinady Please try this as a "New Table"
Test152Out = SUMMARIZE(Test152GroupConcat,Test152GroupConcat[Column1],"Result",CONCATENATEX(Test152GroupConcat,Test152GroupConcat[Column2],";"))
In Power Query, please try this..
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDWNTBS0lEy1TPTMwRCIyOlWB1kYXOwsKEhmrAZRMJUKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Grouped", each Text.Combine([Column2],";"), type text}}) in #"Grouped Rows"
Proud to be a PBI Community Champion
One more question - if I use the calculated table option:
"Test152Out = SUMMARIZE(Test152GroupConcat,Test152GroupConcat[Column1],"Result",CONCATENATEX(Test152GroupConcat,Test152GroupConcat[Column2],";"))"
How can I split the "Result" in separate columns by the ";" separator?
So to end up with something like this (Please note the numver of values may be different for each Column 1 value):
Column 1 Column 2 Column 3 Column 4
03-02 5.6.1.1.22 5.7.1.1.11 5.6.7.1.15
03-01 5.5.1.1.1 - -
03-03 5.6.1.1.17 5.6.7.1.14 -
Thank you!
HI @elinady,
>>How can I split the "Result" in separate columns by the ";" separator?
You can select 'custom' option to use custom character as split separator.
Regards,
Xiaoxin Sheng
Hi, thanks - i tried the Power Query Editor solution however the example I gave is just a small part of the table - the complete table is over 1000 rows with many different values. Also, the values may change in the future. How would that work?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |