Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Running multiple custom visuals at a time locally and passing data between them

Hello,

 

Is there a way to make two custom visuals communicate with each other?

The idea here is to sync axis of the two custom visuals. When one of the custom visuals is zoomed in or zoomed out, the other custom visual should sync in with the axis of the previous one. 

Also, I believe for this we need to run multiple custom visuals locally at the same time. Is there a way for the same?

Would appreciate any lead on this.

 

Thanks in advance!

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

Which custom visual you are using? Do you want to zoom in or zoom out a certain custom visual on the page, and other custom visuals should be zoomed in or out accordingly? If yes, currently it is not possible to achieve it.

Best Regards

Anonymous
Not applicable

https://community.powerbi.com/t5/Developer/data-passing-between-2-custom-visuals-on-the-same-page/m-...

I was following the above thread. And I was trying to pass zoom coordinates from one i-frame to another using Javascript cross window message passing described in this link:

https://javascript.info/cross-window-communication#cross-window-messaging

However, I am getting cross origin error.

Any thoughts on this approach?

 

Thanks in advance!

Hi @Anonymous,

Custom visuals are run in a sandboxed iframe with the allow-same-origin attribute disabled, so looking at your example page, this scenario falls under the following exception and will therefore not work:

 


If an iframe has a sandbox attribute, it is forcefully put into the “different origin” state, unless the allow-same-origin is specified in the attribute value. That can be used to run untrusted code in iframes from the same site.

I have written up a bit about the custom visual sandbox here, if you want to know a little more about it and what challenges you might face when using them. It's probably worth looking at the CORS section, right after this one, too, to understand the cross-origin policy with respect to custom visuals.

If you want instances of the same visual to communicate with each other, you can use the Local Storage API, but this has a number of pre-requisites, including being in the Marketplace and certified.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.