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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
SusuYes
Helper III
Helper III

Transpose Repeating Header Rows into Column Headers after Merging

I have an ICS calendar that I am trying to transform in PowerBI. However, the data I recieve is organised as follows:

Data
Event: NAME XXX
Date: xx xx xx
Location: NOWHERE
URL: www.hi.com
Event: NAME YYY
Date: yy yy yy
Location: SOMEHWERE
URL: www.hello.com

... and so on

I need to be able promote the text before the : delimiter on every four rows as headers. so that my data looks like this:

Event Date Location URL
NAME Xxx xx xxSOMEHWEREhello.com
NAME Yxx xx xxNOWHEREbye.com

I can use SQL or Python or data visualisation software such as PowerBI, alternatively, good ol' Excel works fine.

I tried other tools and workarounds such as uploading the ICS calendar into my Outlook calendar and then exporting the calendar. This worked fine but it is a work around.

 

These are the steps I followed so far: Most of the steps are data cleaning excepting the grouping at the end. 

SusuYes_0-1668579867320.png

however, I cannot properly expand the tables without causing a mess with the data. 

 

Any helps would be appreciated. The data can be found here: shorturl.at/ektHK 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci1LzSuxUvBz9HVViIiIUIrViVZySSxJtVKoqIAgsJBPfnJiSWZ+HlClf7iHa5ArWDQ0yMdKoby8XC8jUy85PxcshmxgZGQkkoGVlRCEZmCwv6+rRzimkak5OfkQU2MB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    Custom1 = Table.FromRecords(Table.Group(Source,"Column1",{"n",each Record.FromTable(#table({"Name","Value"},List.Transform([Column1],each Splitter.SplitTextByDelimiter(": ")(_))))},0,(x,y)=>Byte.From(Text.StartsWith(y,"Event")))[n])
in
    Custom1

wdx223_Daniel_0-1668588832495.png

 

View solution in original post

1 REPLY 1
wdx223_Daniel
Community Champion
Community Champion

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci1LzSuxUvBz9HVViIiIUIrViVZySSxJtVKoqIAgsJBPfnJiSWZ+HlClf7iHa5ArWDQ0yMdKoby8XC8jUy85PxcshmxgZGQkkoGVlRCEZmCwv6+rRzimkak5OfkQU2MB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    Custom1 = Table.FromRecords(Table.Group(Source,"Column1",{"n",each Record.FromTable(#table({"Name","Value"},List.Transform([Column1],each Splitter.SplitTextByDelimiter(": ")(_))))},0,(x,y)=>Byte.From(Text.StartsWith(y,"Event")))[n])
in
    Custom1

wdx223_Daniel_0-1668588832495.png

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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