Forum Discussion
How to dynamically point a Power BI Embedded Report to different Azure Analysis Services
Hi Anonymous,
Could you try the solution below to see it it works in your scenario? :smileyhappy:
1. Use Query Parameter in Data Source dialogs(server and/or database) to create a single dataset, so that you can change the data source by just modifying the corresponding Parameter.
2. Use the the Set parameters operation(Power BI REST API) to dynamically change the Parameters in your code, which will also change the actual connection (server and/or database).
3. Use the Patch data source operation to update the credentials for the changed data source. Reference: https://community.powerbi.com/t5/Developer/Patching-an-Online-DirectQuery-datasource/m-p/351230
Regards
Also on further investigation, looking into Set Paramters and Patch Data Source, neither of these functions are available to me. It appears Set Parameters only works against direct query datasets and my Analysis Services are in In-Memory mode. Also Patch Data Source is an On-Premises Gateway feature and since I'm working entirely in Azure I won't need a gateway - or at least that is my current understanding of gateways.
I'm actually starting to get a little worried that Power BI can't deliver the level of functionality I expected of it. Even my least prefferred approach, having a dataset per customer, doesn't seem to be easily achievable. The only way that I can see to point a Report to another DataSet is to rebind it which it is just switching the embedded dataset to another dataset - there is nothing being redireted during runtime.
In the scenario where I have multiple customers using the Report at the same time I need to be able pass through their query to the correct Analysis Service - changing the hardwired dataset for the report will just cause conflicts between customer such that only one of them will ultimately be able to access their data.
I seem to be in a position where I might have to create a Report per customer such that each Report has it's own embedded dataset. But it seems crazy to me that Embedded Power BI doesn't allow a standard report that can connect back to different datasources depending on the consumer of the report.