Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am currently working on a custom visual for PowerBI.
At the first init, the visual is fine. Everything is well loaded. However, when I switch from one PowerBI page to another, the visual is not updated. I think this is linked to this issue: https://github.com/microsoft/PowerBI-visuals-tools/issues/519
After debugging, I found this plot:
- When the user either refreshes the page or sees the visual for the first time after reloading the page, everything is working. The constructor and the update function are both called.
- However, when the user switches from one page to another, only the constructor is called. The update function does not seem to be called anywhere.
I found two solutions:
- The user refreshes their page, and the visual goes back to normal.
- The user edits the frame containing the visual (resizing, moving...), and the visual goes back to normal.
However, both solutions need to allow the user to edit the dashboard, which is now a proper solution.
Do you have any workarounds?
Thank you in advance 🙂
Solved! Go to Solution.
Hi @TheoAu ,
As the Troubleshooting steps didn't helped in solving the issue, I would suggest to raise support ticket using Microsoft's official support ticket channel using below link:
Create a Fabric and Power BI Support Ticket - Power BI | Microsoft Learn
Thank you.
Hi @TheoAu ,
As the Troubleshooting steps didn't helped in solving the issue, I would suggest to raise support ticket using Microsoft's official support ticket channel using below link:
Create a Fabric and Power BI Support Ticket - Power BI | Microsoft Learn
Thank you.
OK, no problem
thank you for your time 🙂
Hi @TheoAu ,
You are right - this issue occurs because Power BI reconstructs the visual container when switching pages but doesn’t always trigger update(options).Currently, the VisualUpdateOptions object can’t be recreated manually, but you can cache it from the last valid update() call.Store the options in a class variable (e.g., this.lastOptions) and reuse them when the visual is rebuilt.Use an IntersectionObserver or resize listener in the constructor to detect when the visual becomes visible again.When triggered, re-render your visual using the cached VisualUpdateOptions.This workaround ensures your visual refreshes automatically until Power BI fixes Issue.
Thank you.
Hi,
Thank you for your time.
That could be a good option. However, I currently do not have the possibility to store anything, as all the class objects are cleared when the user switches the page. For example:
- The user refreshes/loads the page: the visual is created, and the update function is called. At this moment, I can store an object containing the VisualUpdateOptions.
(we can see in the screenshot that as the constructor is called and the update() is called at least once, we can thus define the updateOptions object.)
- When the user switches the page, the visual seems to be cleaned up from memory (this is logical, memory optimization, as we do not need the visual for the moment).
=> the updateOptions object is removed.
- When the user comes back to the initial page, the visual is recreated from scratch. Thus, I can't retrieve previous variables.
(we can see in the screenshot that as the constructor is called and the update() not called once, we can't define the updateOptions object.)
Is there any other solution?
Hi @TheoAu ,
I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.
Thank you.
Hi @TheoAu ,
fetchMoreData() won’t trigger update() - that call only happens when Power BI signals a data or layout change.
To make your visual refresh automatically, add a visibility or resize listener inside your constructor (not a Power BI API, but standard browser APIs):
Use IntersectionObserver or window.addEventListener("resize", ...) to detect when the visual becomes visible again.When triggered, call your internal render logic (the same code you use in update()) to redraw the visual.
This ensures your visual refreshes when switching report pages without user action, even though update() isn’t called.
Thank you.
Hi, thank you for your answer.
When I (re)load the page, the visual is both constructed and the update(options) function is called with the VisualUpdateOptions in params.
However, when I switch pages and return to the visual, the visual is reconstructed, but the update(options) function is not called. I could force a call with a listener or the examples you provided, but it seems that I do not have a solution to pass the VisualUpdateOptions as parameters if the update(options) function is called for the first time.
Here is an example with a logger:
Initial visual loading - On this screenshot, we can see that both the constructor and the update(options) are called.
When switching page - On this screenshot, only the constructor is called. I could force the update function but I do not have any VisualUpdateOptions object in the constructor.
Having a VisualUpdateOptions object passed to the update function is necessary to make my visual having data inside.
Do you know if any solution exists for now?
Hi @TheoAu ,
Thank you for reaching out to Microsoft Fabric Community.
This behavior happens because Power BI sometimes reloads the visual’s container when switching pages but doesn’t trigger the visual’s update event.
To fix it, make sure your visual refreshes itself when it becomes visible again - for example, by handling visibility or resize events inside your visual logic.If you prefer not to modify the code, you can temporarily refresh the report page or toggle between edit/view mode as a workaround.
The root cause is a known limitation in the Power BI Visuals API, and Microsoft is tracking it in Power BI Visual API; update method not called when changing tabs · Issue #519 · microsoft/PowerBI-vi...
as already mentioned by you.
Until it’s resolved, ensuring the visual re-renders when returning to a page (via visibility or resize triggers) is the recommended approach.
Hi, thank you for your answer !
I tried to make the visual refresh itself by:
- Using the fetchMoreData function: no result, the update function is still not called.
- Calling the update() function myself, but I can't pass the VisualUpdateOptions param as I only have VisualConstructorOptions in the constructor.
Do you have any workarounds to make the visual refresh itself directly in the code? I would prefer not to force the user to refresh the report or toggle the edit/view mode. You also said to use visibility or resize triggers? Are these powerbi visuals api functions?
Have a nice day
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |