Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello everyone,
I have a column with a number of nested data that repeat every 5 values
How do I get a column with label names? (see screenshot)
Thanks in advance
Best Regards
Input
James
M
A213
19/05/1994
London
Maria
F
B623
28/06/1974
Paris
Anthony
M
A931
21/09/1983
Berlin
Solved! Go to Solution.
Here's one way:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMTS1WitWJVvIFk45GhsZghqGlvoGpvqGlpQmY65Ofl5KfB1GYWJSZCGa5gUknMyOIFiMLfQMzoBZziJYAoDqI0Y55JRn5eZXI1lgaG0L0GOobWAL1WECMcEotyskEWhMLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Input = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Input", type text}}),
Labels = {"Name","Gender","ID","Birth","City"},
#"Label Column" = List.Repeat(Labels,Table.RowCount(#"Changed Type")/5),
#"Add Label Column" = Table.FromColumns(
Table.ToColumns(#"Changed Type") &
{#"Label Column"}, Table.ColumnNames(#"Changed Type") & {"Result"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Add Label Column",{{"Result", type text}})
in
#"Changed Type1"
Hello @ronrsnfld ,
Thank you very much, it worked perfectly as always 🙂
Have a nice day
Here's one way:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMTS1WitWJVvIFk45GhsZghqGlvoGpvqGlpQmY65Ofl5KfB1GYWJSZCGa5gUknMyOIFiMLfQMzoBZziJYAoDqI0Y55JRn5eZXI1lgaG0L0GOobWAL1WECMcEotyskEWhMLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Input = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Input", type text}}),
Labels = {"Name","Gender","ID","Birth","City"},
#"Label Column" = List.Repeat(Labels,Table.RowCount(#"Changed Type")/5),
#"Add Label Column" = Table.FromColumns(
Table.ToColumns(#"Changed Type") &
{#"Label Column"}, Table.ColumnNames(#"Changed Type") & {"Result"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Add Label Column",{{"Result", type text}})
in
#"Changed Type1"
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |