I am trying to read a JSON file in powerBI whose data looks like this, But when I expend the column timeseries.data, I can only see ‘timestamp’ column instead of ‘timestamp’ and ‘average’
"cost": 44639,
"timespan": "2023-02-10T23:59:59Z/2023-03-13T23:59:59Z",
"interval": "PT1H",
"value": [
{
"id": "xxxx",
"type": "Microsoft.Insights/metrics",
"name": {
"value": "UsedCapacity",
"localizedValue": "Used capacity"
},
"displayDescription": "The amount of storage used by the storage account. For standard storage accounts, itu0027s the sum of capacity used by blob, table, file, and queue. For premium storage accounts and Blob storage accounts, it is the same as BlobCapacity or FileCapacity.",
"unit": "Bytes",
"timeseries": [
{
"metadatavalues": [
],
"data": [
{
"timeStamp": "2023-02-10T23:59:00Z"
},
{
"timeStamp": "2023-02-11T00:59:00Z"
},
{
"timeStamp": "2023-02-11T01:59:00Z"
},
{
"timeStamp": "2023-02-11T02:59:00Z"
},
{
"timeStamp": "2023-02-11T03:59:00Z"
},
{
"timeStamp": "2023-02-11T04:59:00Z"
},
{ "timeStamp": "2023-03-10T06:59:00Z","average": 19148425} ],
"errorCode": "Success"
}
],
"namespace": "Microsoft.Storage/storageAccounts",
"resourceregion": "eastus"
2
Answers
It looks like your top 1000 records do not contain the
average
key-value pair. You can expand the column as-is and amend the auto-generated formula to expandaverage
as well, for records where this exists.You can also try to re-order your table so that you have records in the top 1000 containing
average
, so you can expand without editing the automatic code generated on expand.This is because scanned 1000 rows do not have average column.
In order to expand timeseries.data into columns timestamp and average in the next step, you can change the query as below.