Forum Discussion
Replace data in PBIX file uploaded to PBIRS (on-prem)
Hi,
Thanks for the quick response. Couple of things:
Your first link is all about importing into Power BI online - I've already done this and I'm now working on equivalent functionality for the on-prem Power BI Report Server. Similarly, the Export API you've linked to is for the online version. Besides, I don't need to export anything.
When I wrote the code for the online version, I manually exported the PBIX to a template (.PBIT), which I then renamed to .zip and then had a look at DataModelSchema. Based on that, I defined my new dataset as a JSON string such as:
{
"name": "mydatasetname",
"tables": [
{
"name": "table1",
"columns": [
{
"name": "col1",
"dataType": "string"
},
{
"name": "col2",
"dataType": "string"
}
]
}
]
}
(yikes - sorry about that formatting - but you get the idea)
The report is simple enough that this definition was sufficient, as it has no calculated column and the like. I had this JSON definition hardcoded in my app, and used it to upload my new dataset definition, before pushing new rows into it (and then finally rebinding to the report).
I know nothing (yet) about TOM/XMLA, but I'm hoping that, in the end, as long as my report remains the same, I can produce a similar hardcoded definition for my dataset. It's not clear from your comment what form this dataset definition takes once defined with either TOM or XMLA, or what API I can use to upload it.
Ultimately my PBIX is rather simple; there's a single table, which has well under 20 columns (so I'm not too worried about those sorts of limitations). For all intents and purposes, the data is going to remain 'static' until a user explicitly clicks a button in my app to extract data from some outside source; my app's job is to then package up that data into a new set of rows for my dataset. The next time the user views the report (by clicking on the .PBIX when browsing PBIRS), the report should then show the new data.
Hopefully this better explains what I'm trying to do, and I hope you can confirm I only need to use TOM/XMLA (once) to define my dataset and then I can leave it at that moving forward (the dataset definition would remain the exact same). In the meantime, I'll start investigating TOM/XMLA.
Thanks.