Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi
I am new to custom visual development and therefore this query.
I have developed a simple custom slicer that, as expected, filters data based on checkbox selections. I am saving the selection state using persistProperties method but on saving the report or reloading, I lose the saved state and instead the last saved state is loaded. What might I be doing wrong here? The state persistence works fine as long as I am navigating within the report.
Any pointers on implementing persistProperties and why I am losing the state on save, would be appreciated.
Hi @pramodx,
It's not clear how you've set up your properties from the details in your question, but using persistProperties is not ideal in this case - for visuals that intend to function as a slicer, use the Visual Filters API and the approaches documented in this page to persist and restore selection state. Power BI will do a lot of the work for you and you then just need to manage the UI handling of restoring selected values from the update options' jsonFilters array into your elements.
If you're using this approach and using persistProperties for some other aspect of your visual's logic, then please share some details of your code, as well as your visual's capabilities, as it's very hard to debug these problems without having this context.
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)
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!