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
allenfirth
New Member

How to display raw json data in Power BI desktop report

I have a dataset in Power BI Desktop that is based on json documents coming out of Cosmos DB. I am able to expand the json documents into columns that I can then use in Power BI. This all works great.

What I am unable to find out how to do is actually display the full and original json content of an individual record.

Basically once the user of my Power BI report has filtered and sliced the data to their satisfaction and reduced it to a small subset of the overall data they will then want to see at a record by record level the full and original contents of the json records.

How do I display this to the users of my Power BI report?

7 REPLIES 7
Anonymous
Not applicable

Hi @allenfirth,

 

You can duplicate your source data, and use text format to store these raw json data as a copy of original data.

 

Step:

1. Click on 'Gear' icon to open the source setting.

2. Modify the 'Open file as' option to Text file.

 

1.PNG

3. Click on 'Ok' to apply these changes.

2.PNG

 

Regards,

Xiaoxin Sheng

Could you please elaborate on where I will find the "gear" icon?

 

Many thanks, 

Allen

Anonymous
Not applicable

Hi @allenfirth,

 

You can find it at query setting tab:

2.PNG

 

Regards,
Xiaoxin Sheng

@Anonymous thanks for the reply. 

 

My datasource is a CosmosDB and NOT a json file so when I click the gear icon on the Source step under query settings, I don't ge tthe option to open the file as text, rather I get a dialog with the connection details to my CosmosDB.

 

Regards, 

Allen

Anonymous
Not applicable

HI @allenfirth,

 

Can you please share some query string which you used in power query? I will check it if I can find some method to work through this situation.

 

Regards,
Xiaoxin Sheng

Thanks @Anonymous

 

Here is my underlying data query:

 

let
Source = DocumentDB.Contents("https://[cosmosdb account].documents.azure.com:443/", "[cosmosdb container]", "[cosmos db collection]"),
#"Expanded Document" = Table.ExpandRecordColumn(Source, "Document", {"ApplicationId", "Application", "Component", "Environment", "TimeStamp", "LoggedOnUser", "Version", "MessageSucceeded", "MessageFailures", "MessageType", "Message", "MessageId", "TimeStampYear", "TimeStampMonth", "TimeStampDay", "TimeStampHour", "TimeStampMinute", "id"}, {"Document.ApplicationId", "Document.Application", "Document.Component", "Document.Environment", "Document.TimeStamp", "Document.LoggedOnUser", "Document.Version", "Document.MessageSucceeded", "Document.MessageFailures", "Document.MessageType", "Document.Message", "Document.MessageId", "Document.TimeStampYear", "Document.TimeStampMonth", "Document.TimeStampDay", "Document.TimeStampHour", "Document.TimeStampMinute", "Document.id"}),
#"Expanded Document.Version" = Table.ExpandRecordColumn(#"Expanded Document", "Document.Version", {"Major", "Minor", "Build", "Revision", "MajorRevision", "MinorRevision"}, {"Document.Version.Major", "Document.Version.Minor", "Document.Version.Build", "Document.Version.Revision", "Document.Version.MajorRevision", "Document.Version.MinorRevision"}),
#"Inserted Parsed Date" = Table.AddColumn(#"Expanded Document.Version", "Parse", each Date.From(DateTimeZone.From([Document.TimeStamp])), type date),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Parsed Date",{{"Parse", "Date"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "VersionDescription", each Number.ToText([Document.Version.Major]) & "." & Number.ToText([Document.Version.Minor]) & "." & Number.ToText([Document.Version.Build]) & "." & Number.ToText([Document.Version.Revision])),
#"Renamed Columns1" = Table.RenameColumns(#"Added Custom",{{"Document.ApplicationId", "ApplicationId"}, {"Document.Application", "Application"}, {"Document.Component", "Component"}, {"Document.Environment", "Environment"}, {"Document.TimeStamp", "TimeStamp"}, {"Document.LoggedOnUser", "LoggedOnUser"}, {"Document.Version.Major", "Version.Major"}, {"Document.Version.Minor", "Version.Minor"}, {"Document.Version.Build", "Version.Build"}, {"Document.Version.Revision", "Version.Revision"}, {"Document.Version.MajorRevision", "Version.MajorRevision"}, {"Document.Version.MinorRevision", "Version.MinorRevision"}, {"Document.MessageSucceeded", "MessageSucceeded"}, {"Document.MessageFailures", "MessageFailures"}, {"Document.MessageType", "MessageType"}, {"Document.Message", "Message"}, {"Document.MessageId", "MessageId"}, {"Document.TimeStampYear", "TimeStampYear"}, {"Document.TimeStampMonth", "TimeStampMonth"}, {"Document.TimeStampDay", "TimeStampDay"}, {"Document.TimeStampHour", "TimeStampHour"}, {"Document.TimeStampMinute", "TimeStampMinute"}, {"Document.id", "id"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns1",{{"TimeStamp", type datetime}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"TimeStamp", Order.Descending}})
in
#"Sorted Rows"

 

The column of expanded data containing the original JSON is called "Message"

Anonymous
Not applicable

HI @allenfirth,

 

It seems these records has been converted to table by connector. So, I'm afraid that is hard to convert back these data.

 

Regards,

Xiaoxin Sheng

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.