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
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.