Forum Discussion
Custom Power BI Visual Not Updating After Repackaging – New version fails to replace old version
- 7 months ago
Hi wolfgang2,
I hope you are doing well today ☺️❤️
So what i will tell you is just a workaround (not an approach but try it):
- So First Force Clear Visual Cache
- Change Visual Identity
- Increment the version number significantly (like from 1.0.0 to 1.0.1) in your visual pbiviz.json file before repackaging
- Delete and Reimport Visual
- Delete the visual from the repor then Clear All permissions from data source
So Final Notes you should take care of it in the future:
- Power BI aggressively caches visuals to improve load times
- When you update an existing visual on a report page...Power BI may only call the visual update() method not its constructor leaving old states intact (This is why your logic needs to be in update())
- Always increment the version number in your pbiviz.json file before packaging and uploading a new version
I hope this works for you ☺️❤️
if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly. - 7 months ago
Hi wolfgang2 , Thank you for reaching out to the Microsoft Community Forum.
From what you are saying, the About pane still shows the old visual version and none of the new logs or formatting metadata appear. That means the updated .pbiviz package is not being loaded at all for the existing visual instance, so your new update() code never executes.
Power BI does not guarantee that visuals already placed on a report will be rebound to a newly uploaded package when the visual GUID remains the same. In that case, it can continue running the previously loaded bundle. Creating a new visual instance, switching visuals or reopening the report forces a fresh instantiation, which is why the new version works in those scenarios. There is currently no supported way to force an in place reload of an already placed custom visual. Removing and re-adding the visual (or changing the GUID during development) is the only reliable way to apply the updated package.
Hi wolfgang2 , Thank you for reaching out to the Microsoft Community Forum.
Power BI does not guarantee that an existing visual instance will be destroyed and when you upload a new .pbiviz with the same visual GUID, Power BI does not guarantee that existing visual instances on the report will be destroyed and recreated. The platform controls the visual lifecycle and may keep the existing instance alive, invoking update() but not the constructor.
This is why changes only appear after creating a new visual instance, switching visuals or reopening the report, those actions trigger a fresh instantiation. There is no supported mechanism to force Power BI to fully reload an already placed visual. As a result, custom visuals must handle all state and rendering logic inside update() and developers should not rely on constructor only initialization for changes to apply to existing visuals.
Visual API for Power BI Visuals - Power BI | Microsoft Learn
Power BI visual system integration - Power BI | Microsoft Learn
Power BI Custom Visuals – Data Visualization Tools | Power BI
- wolfgang27 months agoFrequent Visitor
We are not extensively relying on the constructor, only thing in the constructor are the required initializations like selectionManager, tooltipServiceWrapper and the main svg containers and groups (to avoid re-rendering on each update tick). I have license enforcement logic in the update() method itself which is not working. I've also tried console.log()/debug() and nothing gets logged in the browser console. Even the formatting settings are not updated:
The new version (4.8.3.8) does not show up.
It doesn't matter if I interact with the visual or change data in the field wells.- v-hashadapu7 months agoCommunity Support
Hi wolfgang2 , Thank you for reaching out to the Microsoft Community Forum.
From what you are saying, the About pane still shows the old visual version and none of the new logs or formatting metadata appear. That means the updated .pbiviz package is not being loaded at all for the existing visual instance, so your new update() code never executes.
Power BI does not guarantee that visuals already placed on a report will be rebound to a newly uploaded package when the visual GUID remains the same. In that case, it can continue running the previously loaded bundle. Creating a new visual instance, switching visuals or reopening the report forces a fresh instantiation, which is why the new version works in those scenarios. There is currently no supported way to force an in place reload of an already placed custom visual. Removing and re-adding the visual (or changing the GUID during development) is the only reliable way to apply the updated package.