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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

JSON files into Power BI

I have many JSON files and my problem is that I had to add a new line of information, I thought that it will be enough to add that parameter in the first JSON file then when the PBI won't find the column it will leave it as blank. The difference between the first and second JSON is that the first has the reportName parameter, but the second not, is there any way to adapt a thing like TRY_CAST?

mpataki32_0-1661777463901.png

 

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

Hi @Anonymous ,

 

Example json files:

{
  "datasets": "abcd",
  "reports": "qwe",
  "dashboard": "12345"
}

{
  "datasets": "abcd",
  "reports": "qwe",
  "dashboard": "12345",
  "excel": "noname"
}

 

1 Create a query vis this code:

let
    Source = (Parameter1 as binary) => let
        Source = Json.Document(Parameter1),
        #"Converted to Table" = Table.FromRecords({Source})
    in
        #"Converted to Table"
in
    Source

 

2 Add invoke custom column:

vchenwuzmsft_0-1662018592944.png

3 Expand the Query1 column and result:

vchenwuzmsft_1-1662018645968.png

 


Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Example json files:

{
  "datasets": "abcd",
  "reports": "qwe",
  "dashboard": "12345"
}

{
  "datasets": "abcd",
  "reports": "qwe",
  "dashboard": "12345",
  "excel": "noname"
}

 

1 Create a query vis this code:

let
    Source = (Parameter1 as binary) => let
        Source = Json.Document(Parameter1),
        #"Converted to Table" = Table.FromRecords({Source})
    in
        #"Converted to Table"
in
    Source

 

2 Add invoke custom column:

vchenwuzmsft_0-1662018592944.png

3 Expand the Query1 column and result:

vchenwuzmsft_1-1662018645968.png

 


Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

mahoneypat
Microsoft Employee
Microsoft Employee

I don't think the Table.TransformColumnTypes function supports the MissingFields.Ignore term (which would make this easy to solve). You can use try ... otherwise though. In the formula bar, put try after the = before the Table.TransformColumnTypes expression and then put otherwise after it and then the same expression (with the part referencing the missing column removed).

Error handling - Power Query | Microsoft Docs

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi @mahoneypat , 

Thanks for the reply, my problem is that I have a fear that as we advance with that maybe more and more parameters should be added to the json, there is no any dynamic workaround, but I really understand the limitations and I know that Power BI is not developed to process JSONs.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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