Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I've been working the the REST API to create streaming datasets to test the functionality of each type of dataset: push, push-streaming, and streaming.
Programmitcally, I've created a dataset for each type of streaming dataset with the following tables:
"{\"name\":\"Water_PushStreaming\",\"defaultMode\":\"PushStreaming\",\"tables\":[{\"name\":\"Water_Influent_Volume\",\"columns\":[{\"name\":\"Plant\",\"dataType\":\"String\"},{\"name\":\"Influent_Water\",\"dataType\":\"Int64\"},{\"name\":\"Influent_Water_Cost\",\"dataType\":\"Double\"},{\"name\":\"Timestamp\",\"dataType\":\"Datetime\"}]},{\"name\":\"Plant_Master\",\"columns\":[{\"name\":\"Plant\",\"dataType\":\"String\"},{\"name\":\"Business_Unit\",\"dataType\":\"String\"},{\"name\":\"Business_Group\",\"dataType\":\"String\"}]},{\"name\":\"ATV\",\"columns\":[{\"name\":\"Attr_id\",\"dataType\":\"Int64\"},{\"name\":\"Timestamp\",\"dataType\":\"Datetime\"},{\"name\":\"Value\",\"dataType\":\"Int64\"}]},{\"name\":\"EATV\",\"columns\":[{\"name\":\"Entity_id\",\"dataType\":\"Int64\"},{\"name\":\"Timestamp\",\"dataType\":\"Datetime\"},{\"name\":\"Value\",\"dataType\":\"Int64\"}]}]}"
The problem is when I want to create a live tile, it only lets me choose values from the first table, Water_Influent_Volume. I want to be able to create tiles from multiple tables in this dataset.
Posts to the columns in all datasets return an OK, so it's not as though the data isn't there.
I've also been trying to dig through the un-exposed APIs. When we PUT a tile manually, I get this output:
PUT https://wabi-us-north-central-redirect.analysis.windows.net/powerbi/metadata/tiles/3917004 HTTP/1.1
Content-Type: application/json;charset=utf-8
X-PowerBI-User-GroupId: {group id redacted}
ActivityId: c7561cb1-ad26-c61b-513b-7de681845197
RequestId: 31a8ce52-8b8c-5267-93bf-9392d5c1e316
Authorization: Bearer {token redacted}
Accept: application/json, text/plain, */*
Referer: https://app.powerbi.com/groups/{groupID redacted}/dashboards/{dashboard id redacted}
Accept-Language: en-US
Origin: https://app.powerbi.com
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: wabi-us-north-central-redirect.analysis.windows.net
Content-Length: 2471
Connection: Keep-Alive
Cache-Control: no-cache
{"id":0,"type":8,"config":"{\"realTimeVisual\":{\"elements\":[{\"DataRoles\":[{\"Name\":\"Values\",\"Projection\":0,\"isActive\":false}]}],\"queryMetadata\":{\"Select\":[{\"Restatement\":\"Influent_Water\",\"Name\":\"Water_Influent_Volume.Influent_Water\",\"Type\":3}],\"Filters\":null},\"heading1\":\"Influent_Water\",\"transform\":\"{\\\"objects\\\":{\\\"labels\\\":[{\\\"properties\\\":{\\\"labelDisplayUnits\\\":{\\\"expr\\\":{\\\"Literal\\\":{\\\"Value\\\":\\\"0D\\\"}}},\\\"labelPrecision\\\":{\\\"expr\\\":{\\\"Literal\\\":{\\\"Value\\\":\\\"0D\\\"}}}}}]},\\\"projectionOrdering\\\":{\\\"Values\\\":[0]},\\\"queryMetadata\\\":null,\\\"visualElements\\\":null,\\\"selects\\\":[{\\\"displayName\\\":\\\"Influent_Water\\\",\\\"queryName\\\":\\\"Water_Influent_Volume.Influent_Water\\\",\\\"roles\\\":{\\\"Values\\\":true},\\\"type\\\":{\\\"category\\\":null,\\\"underlyingType\\\":260},\\\"expr\\\":{\\\"Measure\\\":{\\\"Expression\\\":{\\\"SourceRef\\\":{\\\"Schema\\\":\\\"_RealTimeSchema_\\\",\\\"Entity\\\":\\\"Water_Influent_Volume\\\"}},\\\"Property\\\":\\\"Influent_Water\\\"}}}]}\",\"dataWindow\":250,\"visual\":\"card\",\"objects\":{\"labels\":[{\"properties\":{\"labelDisplayUnits\":{\"expr\":{\"Literal\":{\"Value\":\"0D\"}}},\"labelPrecision\":{\"expr\":{\"Literal\":{\"Value\":\"0D\"}}}}}]}},\"version\":\"0.1\"}","displayText":"Blah","subDisplayText":"Test","action":"{\"action\":null,\"targetUrl\":\"\",\"openInSameTab\":false}","query":{"modelQuery":{"sq":"{\"dataWindow\":250,\"tableName\":\"Water_Influent_Volume\",\"mappings\":[{\"metadata\":{\"columns\":[{\"queryName\":\"Water_Influent_Volume.Influent_Water\",\"type\":{\"underlyingType\":260,\"category\":null}}],\"objects\":{\"labels\":{\"labelDisplayUnits\":0,\"labelPrecision\":0}}},\"single\":{\"role\":{\"role\":\"Values\",\"items\":[{\"queryName\":\"Water_Influent_Volume.Influent_Water\",\"type\":{\"underlyingType\":260,\"category\":null},\"hasScalarKey\":false}]}}}],\"Commands\":[{\"SemanticQueryDataShapeCommand\":{\"Query\":{\"Version\":2,\"From\":[{\"Name\":\"w\",\"Entity\":\"Water_Influent_Volume\",\"Schema\":\"_RealTimeSchema_\"}],\"Select\":[{\"Measure\":{\"Expression\":{\"SourceRef\":{\"Source\":\"w\"}},\"Property\":\"Influent_Water\"},\"Name\":\"Water_Influent_Volume.Influent_Water\"}]},\"Binding\":null}}]}"}},"tileDataBinaryBase64Encoded":null,"layoutConfig":"{\"layouts\":[{\"id\":0,\"position\":{\"width\":1,\"height\":1}}]}","modelId":7021386,"colSpan":1,"rowSpan":1}
These obfuscated json elements mean nothing to me yet, but I would like a way to programmatically place a tile on a dashboard without having to deal with the limitations of the UI.
I just need a way to figure out either (a) how to create tiles from tables other than the first table in a streaming or push-streaming dataset or (b) how to programmatically create tiles.
Does anyone know how I should go about this?
Solved! Go to Solution.
Per my experience and understanding on streaming dataset, it only supports one table in the streaming dataset by design. You can see that when enabling the "historical data analysis" option for a streaming dataset created via REST API, it converts to a one-table dataset. I think the Dev team might forget to limit the table numbers when creating a streaming dataset via REST API.
So if you'd like to create tiles for the "other tables" in the streaming dataset, just create one streaming dataset with each table.
As to the un-exposed APIs, it is not recommended. I was digging into some un-exposed ones, but it seems we can't pass the authentication. The access token generated from registered app seems not sufficient.
Per my experience and understanding on streaming dataset, it only supports one table in the streaming dataset by design. You can see that when enabling the "historical data analysis" option for a streaming dataset created via REST API, it converts to a one-table dataset. I think the Dev team might forget to limit the table numbers when creating a streaming dataset via REST API.
So if you'd like to create tiles for the "other tables" in the streaming dataset, just create one streaming dataset with each table.
As to the un-exposed APIs, it is not recommended. I was digging into some un-exposed ones, but it seems we can't pass the authentication. The access token generated from registered app seems not sufficient.
Thank you for the reply, Eric! I thought it might be too much of a stretch to try to hack my way into the unexposed API. This makes sense.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
2 | |
2 | |
2 | |
2 |