Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Data Modelling Assistance

Hi, 

I have the following Source table, 

GUIDChecked by A1-1

Pass or Fail A1-1

Checked by B1-1Pass or Fail B1-1
0001Name APassName CFail
0002Name BFailName AFail

 

, which I want to convert it in the following format - 

GUIDAssetChecked byPass or Fail
0001A1-1Name APass
0001B1-1Name CFail
0002A1-1Name BFail
0002B1-1Name AFail

 

I want to do this in Query Editor and should be dynamic in nature. Both GUIDS, Asset, and Fields may be added later on. In my actual dataset, there 500+ columns, and any query I do takes forever to refresh.

 

I am able to create a dynamic table or lists from the Column names like below, but not sure if that's helpful. Maybe cross join it somehow with the Source query? 

Checked by A1-1Checked byA1-1
Pass or Fail A1-1Pass or FailA1-1
Checked by B1-1Checked byB1-1
Pass or Fail B1-1Pass or FailB1-1

 

My ultimate goal is to normalize the fact table with 500+ columns into dimension tables somehow, and the request format may help. Still kind of exploring various methodologies. Any ideas on how this could be achieved in an efficient manner?

Appreciate the assistance!

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFTSUfJLzE1VcAQyAhKLi2F8ZyDDLTEzRylWB6zQCCbhBJNA0ghRGAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [GUID = _t, #"Checked by A1-1" = _t, #"Pass or Fail A1-1" = _t, #"Checked by B1-1" = _t, #"Pass or Fail B1-1" = _t]),
    Custom1 = Table.Combine(
                            Table.TransformRows(
                                                Source,
                                                each let
                                                        t=Table.SplitColumn(
                                                                            Table.Skip(Record.ToTable(_)),
                                                                            "Name",
                                                                            (x)=>let
                                                                                    a=Text.BeforeDelimiter(x," ",{0,1}),
                                                                                    b=Text.AfterDelimiter(x," ",{0,1})
                                                                                 in {[GUID],a,b},
                                                                            {"GUID","x","Assets"}
                                                                           )
                                                     in Table.Pivot(t,List.Distinct(t[x]),"x","Value")
                                               )
                           )
in
    Custom1

View solution in original post

1 REPLY 1
wdx223_Daniel
Community Champion
Community Champion

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFTSUfJLzE1VcAQyAhKLi2F8ZyDDLTEzRylWB6zQCCbhBJNA0ghRGAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [GUID = _t, #"Checked by A1-1" = _t, #"Pass or Fail A1-1" = _t, #"Checked by B1-1" = _t, #"Pass or Fail B1-1" = _t]),
    Custom1 = Table.Combine(
                            Table.TransformRows(
                                                Source,
                                                each let
                                                        t=Table.SplitColumn(
                                                                            Table.Skip(Record.ToTable(_)),
                                                                            "Name",
                                                                            (x)=>let
                                                                                    a=Text.BeforeDelimiter(x," ",{0,1}),
                                                                                    b=Text.AfterDelimiter(x," ",{0,1})
                                                                                 in {[GUID],a,b},
                                                                            {"GUID","x","Assets"}
                                                                           )
                                                     in Table.Pivot(t,List.Distinct(t[x]),"x","Value")
                                               )
                           )
in
    Custom1

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.