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
lionzandvliet
Frequent Visitor

Convert JSON data to new columns

Im trying to convert a column with JSON-data to new columns. This is my input:

lionzandvliet_0-1634562620484.png

I need my output like this:
lionzandvliet_2-1634562988272.png

 

I'm trying to convert my 'assessments' column to JSON in the Power Query Editor, but not getting the right outcome:

 

lionzandvliet_3-1634563277732.png

 

let
Source = objects,
#"Parsed JSON" = Table.TransformColumns(Source,{{"assessments", Json.Document}}),
#"Expanded assessments" = Table.ExpandRecordColumn(#"Parsed JSON", "assessments", {"36", "43"}, {"product_id", "value"})
in
#"Expanded assessments"

 

 

 

Thanks in advance!

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @lionzandvliet ,

 

If you have the information has you present in the first image you just need to make some addtional steps:

  • Remove the { }
  • Split columns to rows using the comma +space ", " separator:

MFelix_0-1634634792787.png

 

MFelix_1-1634634811265.png

  • Split column by delimiter two dots ":"

MFelix_2-1634634875030.pngMFelix_3-1634634886692.png

Check PBIX file attach, it's not based on JSON but you only need the steps after "opening" the JSON that is what I show here.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
lionzandvliet
Frequent Visitor

@MFelix thanx for your solution.

lionzandvliet_0-1634636368237.png

 

MFelix
Super User
Super User

Hi @lionzandvliet ,

 

If you have the information has you present in the first image you just need to make some addtional steps:

  • Remove the { }
  • Split columns to rows using the comma +space ", " separator:

MFelix_0-1634634792787.png

 

MFelix_1-1634634811265.png

  • Split column by delimiter two dots ":"

MFelix_2-1634634875030.pngMFelix_3-1634634886692.png

Check PBIX file attach, it's not based on JSON but you only need the steps after "opening" the JSON that is what I show here.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.