Reply
gnair21
New Member
Partially syndicated - Outbound

How to Convert Raw data to Structure data

Screenshot 2023-06-05 021200.png

2 REPLIES 2
slorin
Super User
Super User

Syndicated - Outbound

Hi, 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRiolxVIrViVbyS8xNBXKDwRznnMTiYiDPAswLTk0uyczPA/IhSjPyk5IyU0HyzmA+2BQnZFO8UUyxBPM880pSi1KLS4ACvmABx3SQUiMDhBnOyGZ4gDmJEEXGYE4x3CFOaA4JzsxLByKl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t]),
Proper = Table.TransformColumns(Source,{{"Column 1", Text.Proper, type text}}),
Group = Table.Group(
Proper,
{"Column 1"},
{{"Data", each Table.PromoteHeaders(Table.Transpose(_))}},
GroupKind.Local,
(x,y) => if y[Column 1]="" then 1 else 0),
Formatted_Data = Table.Combine(Group[Data])
in
Formatted_Data

 

Stéphane

wdx223_Daniel
Super User
Super User

Syndicated - Outbound

wdx223_Daniel_0-1685924470896.png

import your date without headers, then try this code.

= Table.Combine(Table.Group(Source,"Column1",{"n",each let a=Table.Skip(_) in Table.FromRows({{[Column2]{0}}&a[Column2]},{"Category"}&List.Transform(a[Column1],Text.Proper))},0,(x,y)=>Byte.From(y=null))[n])

avatar user

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)