Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'd like to persist the scroll position of my visual. However, when I call persistProperties, I get called back with an update and therefore reload my data, which isn't practical. Any way to keep this from happening or some other way to persist the information?
1. Tried doing it on destroy(), but that doesn't seem to get called.
2. Can't use localstorage because I can't get the visual certified.
3. Maybe some way to recognize that the data hasn't changed? I may resort to a checksum if no better way.
Thanks.
-jpr
Thanks, Daniel. The update type comes back as data, so no joy on that one.
Doing a hash on the matrix part of the dataview is doing the trick for now.
Appreciate your thoughts and your source code.
-jpr
Hi @jprdynamicapps,
If you want to use persistProperties, you can't avoid an update being called, as the properties need to be re-enumerated. However, you can check options.type in your update method to determine the kind of operation being carried out and route your logic accordingly.
If it's VisualUpdateType.All or VisualUpdateType.Data, then this indicates the dataView should be re-checked. Otherwise, you should be able to leave it unprocessed. Here's an example of how you might handle this using one of my visuals, if you want to take a look.
It's been a while since I've looked at this in detail, but IIRC manually changing a property in the pane will definitely flag a change in a visual's dataView, but persistProperties might not. If it does, then your idea of a checksum may be how to proceed for subsequent updates, if/when they fire.
Hopefully this provides you with some ideas. Good luck!
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.