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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jprdynamicapps
Helper IV
Helper IV

persist properties without reloading?

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

2 REPLIES 2
jprdynamicapps
Helper IV
Helper IV

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

dm-p
Super User
Super User

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





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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.