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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

COnvert rows as column headers

Hi all,

I have loaded below data into desktop.

serviceSUb groupattributevalue
auditlogjan8
auditlogfeb9
auditlogmar10
auditlogapr11
auditlogmay12
auditafcjan6
auditafcfeb7
auditafcmar8
auditafcapr9
auditafcmay10
auditcnfjan11
auditcnffeb12
auditcnfmar13
auditcnfapr14
auditcnfmay15
auditrbgjan16
auditrbgfeb17
auditrbgmar18
auditrbgapr19
auditrbgmay20
debuglogjan14
debuglogfeb15
debuglogmar16
debuglogapr17
debuglogmay18
debugafcjan19
debugafcfeb20
debugafcmar5
debugafcapr6
debugafcmay7
debugcnfjan8
debugcnffeb9
debugcnfmar10
debugcnfapr1
debugcnfmay2
debugrbgjan3
debugrbgfeb4
debugrbgmar5
debugrbgapr5
debugrbgmay6

 

Now, in query editor need to conert sub group values as headers in below format.

serviceattributelogafccnfrbg
auditjan861116
auditfeb971217
auditmar1081318
auditapr1191419
auditmay12101520
debugjan141983
debugfeb152094
debugmar165105
debugapr17615
debugmay18726

Can any body please help on this ASAP.

 

 

Thanks

Praneeth

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous, 

 

You can select the column SUb group then click on the Pivot Column: 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZPLDoIwEEV/xXTNQlRe32FcERctFoJRIJWa8PcWZsQW72bS9OQmJ9PbshQvbd5tpUUkzhe1a0xvB3eW42haZcf5/i0fVotrVAppb+3obh594+Zddm7mgNRauVkA8pTGzXgPkBwWFMPUNKNDgGRdrRIpICSRAUISOSDkUMDM9C9edfWqsBEnRA4bcUK8iSNAvIkTTC0aSYCM+j1HnALEGhlArJEDxBoFTM0aB9rGTSvbbFrB8iFijQQg1kgBYo0Mpqaf/Bf5vWD5EJHGRt5vRgIIWaQwM609+xK/GDkg/gcJSfBBQsSLgKHlOQLil+IICCmcAEFL8BuBCBm49Vw/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t, #"(blank).3" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}, {"(blank).3", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"service", type text}, {"SUb group", type text}, {"attribute", type text}, {"value", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[#"SUb group"]), "SUb group", "value", List.Sum)
in
    #"Pivoted Column"

 

q9.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi All,

 

I have data like below and loaded into power bi desktop.

serviceSUb groupattributevalue
auditlogjan8
auditlogfeb9
auditlogmar10
auditlogapr11
auditlogmay12
auditlogjan6
auditlogfeb7
auditlogmar8
auditlogapr9
auditlogmay10
auditcnfjan11
auditcnffeb12
auditcnfmar13
auditcnfapr14
auditcnfmay15
auditcnfjan16
auditcnffeb17
auditcnfmar18
auditcnfapr19
auditcnfmay20
debuglogjan14
debuglogfeb15
debuglogmar16
debuglogapr17
debuglogmay18
debuglogjan19
debuglogfeb20
debuglogmar5
debuglogapr6
debuglogmay7
debugcnfjan8
debugcnffeb9
debugcnfmar10
debugcnfapr1
debugcnfmay2
debugcnfjan3
debugcnffeb4
debugcnfmar5
debugcnfapr5
debugcnfmay6

 

After laoding data into power bi I want transpose it into below format by using query editor.

serviceattributelogafccnfrbg
auditjan861116
auditfeb971217
auditmar1081318
auditapr1191419
auditmay12101520
debugjan141983
debugfeb152094
debugmar165105
debugapr17615
debugmay18726

Please help me if any have solution for this.

 

Thanks

Praneeth

@Anonymous based on dataset you provided, are you lookig for following result

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous, 

 

You can select the column SUb group then click on the Pivot Column: 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZPLDoIwEEV/xXTNQlRe32FcERctFoJRIJWa8PcWZsQW72bS9OQmJ9PbshQvbd5tpUUkzhe1a0xvB3eW42haZcf5/i0fVotrVAppb+3obh594+Zddm7mgNRauVkA8pTGzXgPkBwWFMPUNKNDgGRdrRIpICSRAUISOSDkUMDM9C9edfWqsBEnRA4bcUK8iSNAvIkTTC0aSYCM+j1HnALEGhlArJEDxBoFTM0aB9rGTSvbbFrB8iFijQQg1kgBYo0Mpqaf/Bf5vWD5EJHGRt5vRgIIWaQwM609+xK/GDkg/gcJSfBBQsSLgKHlOQLil+IICCmcAEFL8BuBCBm49Vw/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t, #"(blank).3" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}, {"(blank).3", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"service", type text}, {"SUb group", type text}, {"attribute", type text}, {"value", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[#"SUb group"]), "SUb group", "value", List.Sum)
in
    #"Pivoted Column"

 

q9.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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

Fabric Community Update - June 2025

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