cancel
Showing results for 
Search instead for 
Did you mean: 
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 I
Super User I

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 I
Super User I

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

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors
Top Kudoed Authors