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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dkangel21
Frequent Visitor

Wait for all visuals to load

Is there a way to know when all visuals are finished loading?  I am resetting the filters on the constructor but depending on how heavy the report is the timing can get a bit flaky.  I need a way to tell when ALL visuals are finished loading after I do the reset.

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @dkangel21 - no, a visual only knows about itself and cannot communicate with others. A visual that filters others and syncs its filter with others only shares the filter with Power BI and this will get passed via the main window; any visual instances do not directly talk to each other.

If you're using filters in your visual, these are sent to Power BI for delegation via the filtering APIs but ultimately Power BI will decide how to apply them to other visuals in the same page.

If your visual is pushing a filter to Power BI for delegation, this would cause Power BI to supply any other affected visuals on the same page with a new data view based on the results of this criteria and trigger them to reload anyway, so knowing whether they have finished loading should theoretically be moot.

It's also typical to apply filters in a visual once the update method has run, rather than in the constructor so that you know your data view is populated with the column/measure metadata necessary for filtering other visuals. In the constructor, this would not be known to your visual, which is why you may be experiencing some issues here.

If you still believe this is a necessary feature then you could try creating an idea for it in the SDK's GitHub repo and perhaps the team can take a look and advise accordingly. 

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

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)




View solution in original post

2 REPLIES 2
dkangel21
Frequent Visitor

Thank you Daniel for clarifying.  The reason I ask is I am in a race condition.  I had solved the problem initially by using an init flag in the constructor and handling the update differently in the update function.  It works great on a simple report but if it is a complex report I have no guarantee of the order of the update hence my issue.  

 

My end Goal is to Clear out the local filter on Load thereby being able to grab the latest date and reapply my previous filter which is dependent on the max date.  Its a bit tricky since there is another date control outside of my custom control.  I am 99% there.  However the race condition doesn't guarantee the order.  My thought was if I could know when the visuals were fully loaded I could then apply my clear followed by my reapplication of the filter.  I think I may be out of of luck.  I am open to any suggestions.

dm-p
Super User
Super User

Hi @dkangel21 - no, a visual only knows about itself and cannot communicate with others. A visual that filters others and syncs its filter with others only shares the filter with Power BI and this will get passed via the main window; any visual instances do not directly talk to each other.

If you're using filters in your visual, these are sent to Power BI for delegation via the filtering APIs but ultimately Power BI will decide how to apply them to other visuals in the same page.

If your visual is pushing a filter to Power BI for delegation, this would cause Power BI to supply any other affected visuals on the same page with a new data view based on the results of this criteria and trigger them to reload anyway, so knowing whether they have finished loading should theoretically be moot.

It's also typical to apply filters in a visual once the update method has run, rather than in the constructor so that you know your data view is populated with the column/measure metadata necessary for filtering other visuals. In the constructor, this would not be known to your visual, which is why you may be experiencing some issues here.

If you still believe this is a necessary feature then you could try creating an idea for it in the SDK's GitHub repo and perhaps the team can take a look and advise accordingly. 

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

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)




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors