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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Super User
Super User

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
Super User
Super User

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors