March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
My custom visual gets 5 updates on startup.
options.type for these updates is:
1. 64 //VisualUpdateType.FormattingSubSelectionChange
2. 128 //VisualUpdateType.FormatModeChange
3. 36 //VisualUpdateType.Resize + VisualUpdateType.ResizeEnd
4. 2 //VisualUpdateType.Data
5. 36 //VisualUpdateType.Resize + VisualUpdateType.ResizeEnd
6. 2 //VisualUpdateType.Data
Is it normal? If so how to avoid rerendering my visual.
I wonder if it's related to my PowerBI account.
Would anyone be so kind to run this sampleBarChart visual on your machine and tell me what update types you gets?
https://github.com/microsoft/PowerBI-visuals-sampleBarChart
It's very easy to set up:
1. Install dependencies
npm install
2. Serve visual
npm run start
Hi @emiljas,
Using the sample bar chart repo, If I refresh the visual with data in the data view, I get one update with a 510 (VisualUpdateType.All) as expected:
The only time I can get multiple update methods to be called is when I put the visual in and out of focus mode (which is expected due to changes in the viewport between states).
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
@dm-p I also gets 510 when I hit refesh button but could you check what if you save report and reload page?
If I save and reload the page, I do get a few more updates. These are not necessarily the same as you, or in the same order, but there are definitely more of them:
Interestingly, if I navigate away from the report and re-open it, I just get two VisualUpdateType.Resize | VisualUpdateType.ResizeEnd updates when my visual loads:
If I do a 'refresh visuals' operation (top-right corner when viewing the report), I get the following:
I would presume that there are reasons for the quantity of the updates, and I would still recommend my advice of defensively handling update types for your visual so that you only run the logic you need to when you need to. However, if you want to know why these updates occur, it would be best to check with MS directly. They don't monitor the forums, so you can either open an issue in the powerbi-visuals-api repo or email them at pbicvsupport@microsoft.com for specific questions.
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Besides of my custom visual I also tried on this visual:
https://github.com/microsoft/PowerBI-visuals-sampleBarChart
The same results...
It seems odd—you typically get the updates needed from the visual host and for startup, this is usually one if you have data present (or if you're using the landing page API). I've tried a few of my projects (just in case there has been a recent change to the developer visual that I haven't noticed), and this is still the case.
Does this happen if you create a new visual project, or is it with your implemented logic? If the latter, are you doing anything as part of your visual update process, such as handling property migration or additional data fetching? These operations will trigger additional updates from the visual host. If you haven't confirmed, it could be good to check the interaction diagram, to check what operations trigger what, and to eliminate anything from your logic that might be superfluous for this process. Note that you may need to consider filtering these by checking the update type and routing accordingly (if they exist) so that you don't unnecessarily cause these updates when they're not needed.
Beyond that, you may need to share your update method so we can see if anything obvious sticks out. It would also be good to know which version of the API and visuals tools you're using (just in case mine are different to yours).
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
No, "General -> Properties -> Advanced options -> Responsive" toggle is off and disabled
did you set it as responsive?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!