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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sevenhills
Super User
Super User

Converting file data into columns - power query

Hi all,

 

I am combining multiple files, which are semistructured. I am providing sample data which I need to convert into columns. Any help is appreciated. The data looks like below:

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("zZhNc6IwHMa/SoZeq+YNEG9dtbM9bN90xoP1wNSsMqXgYDz0229CBMIUbA3pjhyQB0KeHyE8+Y/LpYOca+eZ7dKMg7vJCDw/zvu/0/0u4mHcn7BdmPF3lvA+guiFA3073jQJORsBDDHpQdpDSFxBwQhCveljuGHyPEj/ggA6q+ulg4VtfkAq/3nEY9HXIs3ewM1+H20SaQ1mW8Z43pYWN7nioKAc5RZS8SiMAYLKwCva+uJgnK4ZqJ4GfNqeDikPAbhLOMsS0Yt4rA95HtIB8gby6ZTARBMElsIdQF8TiGoCo1zkMEMB89n9m5v0xzpMoPt7uj/R/XVM7FcwgYDpfbEBtQelBvmuOpGrbiKHQVDQTMXbA9N3lm1Y8vrRPAq+mlo3CP56AmB2SPKhgRhX4wTxUBeBLpAmCNEFUhzI6BX9SQsO3eAEh45b58CKAxtxzA9MdYNq1u0cNeum8SBGHAu2PnLU3HQO0n6lJqjioGbjsT0cDVrfS+2pT3C4isM14rjNoga3uvC+x3F8L54RxyzkRTdan7Qm6FkcfhG06Lxwu2dsLSfJ4k0RIVKtGWLW6IJqAsPWZoGnOIKCCMtMGctMGW+jeJ2xZN/MQtz8Z+x5t7gtU2of1IlZ3fANYZuZ0oXDZqZ04bCZKV04bGZKFw6bmdKFw2amdOEoMwVfSKbgMlMI/H8FM9YKZoJKAnxGyUxIeRv9umgmbtnau6SymfiXVDeT4SUVzkROzQc50x+S1zRONy11808XzhReRuFMzRZb64UzNVtsrRfO1GyxtV44U7PF1nrhTM0WW+uFMy3/oaDnpduPLXJ0WBLJTLnqg+n9BFz1ndXqHw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"File Row Number" = _t, #"Row Details" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"File Row Number", Int64.Type}, {"Row Details", type text}})
in
    #"Changed Type"

 

 

 

 

sevenhills_0-1681787621402.png

 

Dates are dynamic and each file will have different dates.

 

Output format expected:

   Data columns:

  • Report ID
  • Report Date Time
  • Report Title
  • Hospital
  • Code
  • Department
  • Quota
  • Internal
  • Date Range
  • Day
  • Value
  • Optional: Page Details

 

TIA

1 REPLY 1
lbendlin
Super User
Super User

I would suggest you ... run for the seven hills ...  (Sorry, could not resist)

 

Since the data is in fixed width you can split each line (row) by position as needed.  It will be a giant effort to set that up but it's not that complex.

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.