This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
Hey just (hopefully) a simple question:
I got input by dataverse like this format:
Column1 Name1 Name2
08. Mario Luca
Now i just want to convert the Name2 column to the Name1 by copie the whole entry.
It should look like this:
Column1 Name1
08. Mario
08. Luca
Thanks for any advice
Solved! Go to Solution.
pls try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrDQU9JR8k0syswH0ocW+JQmJyrFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Name1 = _t, Name2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Name1", type text}, {"Name2", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Column1"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"})
in
#"Removed Columns"
Hi @FOMO
Just as @Ahmedx says, use Unpivot Other Columns is a viable approach. Here is my method.
I create a table as you mentioned.
Then I use Unpivoted Columns, it gives me Attribute and Value.
Finally I use Remove Columns to remove Attribute. I also change Value to Name1.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @FOMO
Just as @Ahmedx says, use Unpivot Other Columns is a viable approach. Here is my method.
I create a table as you mentioned.
Then I use Unpivoted Columns, it gives me Attribute and Value.
Finally I use Remove Columns to remove Attribute. I also change Value to Name1.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pls try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrDQU9JR8k0syswH0ocW+JQmJyrFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Name1 = _t, Name2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Name1", type text}, {"Name2", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Column1"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"})
in
#"Removed Columns"
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 24 | |
| 21 | |
| 20 |