1
votes

So, currently I'm having difficulty understanding how Power BI Embedded can be setup so that each customer can access data from their own separate Azure Analysis Service, this is an App Owns Data situation. Analysis Services will be running in In-Memory mode and it will be accessed from Power BI via Live Connect.

Ideally I would like the Power BI Report to be ignorant of the data set/data source until the embedded report is provided with a parameter (e.g. connection string) which the report interprets so that it knows which server to connect to. So, ideally have: one Workspace, one Report, and zero (or a fake) Dataset.

The following is roughly what I'm looking to do (note the Red and Blue flow access a different server):

enter image description here

It looks like if I created both a Report and Dataset per customer I can achieve my goal but this seems like a poor approach since if the Report needs to be updated this involves updating, potentially, hundreds of reports. Also creating hundreds of Reports seems like unnecessary overhead when all Power BI needs to change for each request is the connection string pointing to the data source.

So is it possible to share the Workspace and Report across all customers but having completely separate data sources? Or is my approach in conflict with the way Power BI expects to function?

To date, I've tried using Query Parameters when configuring the data source in Power BI Desktop but I get the following error:

The connect live option for this file is disabled because it already contains data from another data source. You cannot explore live data and connect to another type of data source in the same file.

1

1 Answers

3
votes

Please note,

Every report in Power BI can be connected to only one Dataset. There is NO ability to dynamically change a connection string on the fly.

Currently, and in the foreseeable future, you'd have to clone the report & dataset per customer (or per connection setup) and modify the new dataset's connection string to match.

You can then dynamically choose which report to display based on your customer's needs.

Cloning a report can be done using:

POST https://api.powerbi.com/v1.0/myorg/reports/{report_id}/Clone

POST https://api.powerbi.com/v1.0/myorg/groups/{group_id}/reports/{report_id}/Clone

https://msdn.microsoft.com/en-us/library/mt784674.aspx

Changing the connection string would be done using:

POST https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/Default.SetAllConnections (similar API for groups)

https://msdn.microsoft.com/en-us/library/mt748181.aspx

using the C#.NET library provided by Power BI team, you'd use

Reports.CloneReport(string reportKey, CloneReportRequest requestParameters)

Datasets.SetAllDatasetConnections(string datasetKey, ConnectionDetails parameters)