Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
We have a Power BI dashboard embedded in a the angular view provided by MS. It has hyperlinks that open content in a sub-domain of our website (one per tenant). I need the base url of that link to be set via configuration or dynamically detected as the url is different per tenant and I don't want to manually republish every 'instance' of my dashboard (currently auto deployed).
On the server side we make an embed token setting the report id, datasource id etc. Most of our reports do NOT use RLS so we don't set the identity.
Reference: https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token
On the client side we set the Report Settings including the embedURL including some custom filter values.
Reference: https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/configure-report-settings
In the dashboard we generate links on rows in a grid that say "Open" and have a hyperlink to https://tenant.domain.com/item/xxx
The same report (pbix) is auto published to multiple tenants and has its data source dynamically changed (this was hard work and tempremental!).
The issue is the above url is hard coded to whatever tenant we first saved the PBIX against. It needs to be either:
I'm struggling to find a way to do either....
For passing I have looked at RLS effective identity > CustomData but we don't want RLS and people report this doesn't work anyhow. I've also looked at the settings object above and can't see any way to pass extra data.
Suggestions please. Thanks, Matt
Solved! Go to Solution.
Thanks for the response. Yes we want urls that point to the specific tenants domain.
After a restless night I found a solution....
In PowerBI we modified our urls to have a placeholder for the base url e.g. www.BASE.URL/api/xxxxx
We changed the default hyperlink behaviour to RaiseEvent and not open the urls.
We then attached a handler to the dataHyperlinkClicked event:
https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/handle-events#datahyperlinkclicked
This handler then replaced "base.url" with the browsers current domain and opens it in a new window.
This achieves the required functionality.
Hi @MattPilWork ,
According to your statement, I think your requirement is to link to report dynamicly based on user and tenant.
As far as I know, the pbi report does not contain methods to extract data from external parameters (urlstring, seession, cookie, etc.).
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the response. Yes we want urls that point to the specific tenants domain.
After a restless night I found a solution....
In PowerBI we modified our urls to have a placeholder for the base url e.g. www.BASE.URL/api/xxxxx
We changed the default hyperlink behaviour to RaiseEvent and not open the urls.
We then attached a handler to the dataHyperlinkClicked event:
https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/handle-events#datahyperlinkclicked
This handler then replaced "base.url" with the browsers current domain and opens it in a new window.
This achieves the required functionality.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.