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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
patrickmlsk
Frequent Visitor

Expand column with JSON file

Hey!

 

I want to expand three values from a field in a JSON column of a table and add these three values as new columns into the table. The javascript is constructed in the same way all the time. So as an example: 

 

The javascript looks like this:

 

{
  "type": "XXX",
  "currenttype": 0,
  "typecontent": [
    {
      "angleSide": "none",
      "direction": "none",
      "size": {
        "x": XXX,
        "y": XXX,
        "z": XXX
      },
      "sizeTop": {
        "x": XXX,
        "y": XXX,
        "z": XXX
      },
      "sizeOuter": {
        "x": XXX,
        "y": XXX,
        "z": XXX
      },
      "materials": {
        "front": "XXX",
        "back": "XXX",
        "top": "XXX"
      },
      "typearticlenumber": "XXX",
      "articlenumber": "XXX",
      "elements": [

etc. ... 

The three values that are of importance are: "front", "back", "top". So ideally the table should look like this:

 

Thanks for the help!

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

@patrickmlsk ,

 

After import the json file, you can click list-> Record-> Record(Material)s, then click "Into Table", click column "Name" column, then click Transform-> Pivot Columns.

1.PNG 

The result will be like below;

2.PNG 

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@patrickmlsk ,

 

After import the json file, you can click list-> Record-> Record(Material)s, then click "Into Table", click column "Name" column, then click Transform-> Pivot Columns.

1.PNG 

The result will be like below;

2.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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