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
- Anonymous8 years agoNot applicable
Thanks for the response v-ljerr-msft. This approach looks like the style of approach I was looking for but I can't even get query parameters working. My existing reports which access Azure Analysis Services via Connect Live don't have an option for changing the data source - the option is just greyed out. So it's not possible to get to the Data Source dialogs.
To get around this I create a new report, and if I pick an Analysis Service as the data source and specify a parameter for the server, when attempting to connect I get either a silent fail (i.e. after pressing ok on the dialog the loading spinner spins forever) or 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.
It appears to me that this error occurs because when you specify query parameters for a data source then the Current Value that you have to specify is stored as a data source. Connect Live does not seem like having an embedded data source and this result in the error I provided. Or at least that is my interpretation of what is happening.
After getting the above error, if I try to connect again the Connect Live is greyed out. If I use the Import option, just to see if I could get something working, I get told the parameter must be a host name or a http url. My paramater value starts with asazure://xxxx so it not a host name or http url.
Considering the problems I'm getting. Do you know if query parameters for the data source and Connect Live actually are know to work together? And if so, I would be interested in figuring out what it is I'm doing wrong.
It's somewhat frustrating that there isn't config files where these configuration options can be edited as I'd be a lot more comfortable editing XML or json instead of clicking lots of buttons.
- Anonymous8 years agoNot applicable
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.