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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
aalbano
New Member

[Help Requested] PowerQuery Formatting into Either JSON or CSV file

Hi all,

 

I have this string of data from that I want to convert to either a CSV or JSON and eventually upload to SQL for further editing. 

 

Link: https://gist.github.com/Granitosaurus/0a9555c43a4261bed63ba57d095a5205 

 

The formatting is off as when I upload to PowerQuery, it is recognizing the data as a single column instead of the regular JSON/CSV formatting. 

 

Ideally, I would like the formatting to be broken down into columns rows as:

 

05/09/2022 - 19:000.00.00.0

05/09/2022 - 19:01

0.00.00.0 
05/09/2022 - 19:020.00.00.0
05/09/2022 - 19:030.00.00.0
05/09/2022 - 19:040.00.00.0
............

 

I am rather new on PowerQuery, so I hope there's a possible solution for this instead of using something like a Python Regex to parse the data.

 

Any help is much appreciated. 

 

Thank you!

 

 

5 REPLIES 5
ZhangKun
Super User
Super User

 

let
    GetData = Web.Contents("https://gist.githubusercontent.com/Granitosaurus/0a9555c43a4261bed63ba57d095a5205/raw/3ab1b559dfa6d434d4b005be1bc7994345ddab65/some%2520graph"), 
    Readjson = Json.Document(GetData)[data], 
    ConvertRecord = List.Transform(Readjson, each {[label]} & [value]), 
    ResultTable = Table.FromRows(ConvertRecord)
in
    ResultTable

 

v-sgandrathi
Community Support
Community Support

Hi @aalbano,
Hope you are doing well. 

 

Firstly ensure the file is valid JSON before renaming. If not, structure it correctly and use the JSON connector.
For raw or semi-structured data, use Power Query to clean and split it into rows/columns before converting to CSV.

To cleanse data in Power Query:

  • Open Power BI, go to Get Data, select Text/CSV, and load the file or paste the data. Power Query will treat it as a single column initially.
  • In Power Query, select the column, go to the Transform tab, and choose Split Column by Delimiter.
  • After splitting, go to Transform, Trim to remove spaces and rename columns if needed.  Then save the cleaned and structured data as a CSV file.

By following the above steps you might achieve the desired output.

 

Please mark the helpful reply as the solution to assist others with similar queries. If you encounter further issues, don’t hesitate to reach out!


Thankyou for reaching out to the Microsoft Fabric Community Forum!

Hello @aalbano.

 

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

Thankyou for connecting with Microsoft Community Forum.

 Hi @aalbano,

 

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

 

Thanks for using Microsoft Fabric Community Forum.

 

 

m_dekorte
Super User
Super User

Hi @aalbano,

 

Your GitHub file doesn't have a JSON extension.

Saved with that extension let's you use the JSON Connector and data seems to be loading properly.

m_dekorte_0-1738048614207.png

 

I hope this is helpful

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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