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
Anonymous
Not applicable

Pulling data from JSON in Power BI

Hi Team,

 

I am pulling data from MongoDB in Power BI and data is in document format.

 

(

id:- 1

name :- Shubham

Position :- Developer

}

(

id:- 2

name :- Swapnil

Position :- Senior Developer

}

(

id:- 3

name :- Fayaz

}

 

Now this is supposed to be 3 rows and 3 columns in Power BI, but Position column is not avaialble in 3rd JSON due to which it only id and name by excluding Position column from entire dataset.

 

idname
1Shubham
2Swapnil
3Fayaz

 

But i wanted to result to be like this :- 

 

idnameposition
1ShubhamDeveloper
2SwapnilSenior Develop
3Fayaznull

 

Could you please help me with this ? 

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

I have test on my side, it works well.

3.JPG

 

and here is power query code:

 

 

let
    Source = Json.Document(File.Contents("C:\Users\linli\Desktop\test.json")),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "name", "Position"}, {"id", "name", "Position"})
in
    #"Expanded Column1"

 

 

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

I cannot get that JSON to validate so hard to help.

https://jsonlint.com/


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Please find corrected JSON

 

[{
"id": 1,
"name": "Shubham",
"Position": "Developer"
},
{
"id": 2,
"name": "Swapnil",
"Position": "Senior Developer"
},
{
"id": 3,
"name": "Fayaz"
}
]

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.