The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
HI,
I have a table like the following:
ID | CARACT | VALUE |
a1 | caract1 | value1 |
a1 | caract2 | value2 |
a2 | caract1 | value3 |
a2 | caract2 | value4 |
I would like to transform it into:
ID | caract1 | caract2 |
a1 | value1 | value2 |
a2 | value3 | value4 |
I mean, the ID column would look exactly the same, but the column carac is replaced by the columns that used to be the rows, obtaining the values of the column value.
I tried to transpose but I also transposed the ID column and they appear wrong.
How can I do this transormation?
Thank you very much.
Solved! Go to Solution.
Hi @silvias ,
Go to PowerQuery, select the column Caract and choose Pivot Column.
Select Value as values column and in the advanced options choose Don't aggregate.
If I answered your question, please mark it as a solution to help other members find it more quickly.
Hi @silvias ,
Go to PowerQuery, select the column Caract and choose Pivot Column.
Select Value as values column and in the advanced options choose Don't aggregate.
If I answered your question, please mark it as a solution to help other members find it more quickly.
@silvias try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSjRU0lFKTixKTC4BscoSc0pTDZVidVBkjGAyRhAZI0w9xugycD0mSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, CARACT = _t, VALUE = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"CARACT", type text}, {"VALUE", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[CARACT]), "CARACT", "VALUE")
in
#"Pivoted Column"
@silvias In PowerQuery select column 'CARACT' and choose 'Pivot Column' on Transform Tab.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
80 | |
77 | |
43 | |
39 |
User | Count |
---|---|
150 | |
116 | |
66 | |
64 | |
55 |