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
JohnKris
Regular Visitor

JavaScript API - Data Selection Events - Catch Deselect Event

Hi,

great work with the JavaScript API!

 

With reference to Scenario 7: Data Selection in the Power BI JavaScript API demo.

 

We have successfully managed to embed our report and catch event.detail data after user click on the embedded power BI report.

However, we have not yet managed to catch deselect/unselect event to reset the in-page report filters. For instance, when you click directly on the bar graphs to filter the data, and then you click again on the same bar graph - the visuals are updated but not the data selected event...

 

Do you have any suggestion on how to catch this "deselect/unselect" event?

1 ACCEPTED SOLUTION

Thank you for your reply.

After I created this post we actually managed a workaround, almost by accident. We catched the "deselect" event by using the error handler event. See image, we get "error: CustomEvent", and inside the detail: Object we get a message saying "Could not serialize a data point."error.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Anyways, it would be very good with a detailed documentation update. As developers we spend a lot of time with trial and error.

 

View solution in original post

4 REPLIES 4
Eric_Zhang
Employee
Employee


@JohnKris wrote:

Hi,

great work with the JavaScript API!

 

With reference to Scenario 7: Data Selection in the Power BI JavaScript API demo.

 

We have successfully managed to embed our report and catch event.detail data after user click on the embedded power BI report.

However, we have not yet managed to catch deselect/unselect event to reset the in-page report filters. For instance, when you click directly on the bar graphs to filter the data, and then you click again on the same bar graph - the visuals are updated but not the data selected event...

 

Do you have any suggestion on how to catch this "deselect/unselect" event?


@JohnKris

 

That "reset" by clicking and clicking again seems just the Visualization interactions in a Power BI report. As per Handling Events page on github, it lists all events supported so far and there seems no such ""deselect/unselect" event.


The github documentation on the Power BI Javascript API is very limited, I'll escalate a content request internally and would share with you if there're more documents.



 

Thank you for your reply.

After I created this post we actually managed a workaround, almost by accident. We catched the "deselect" event by using the error handler event. See image, we get "error: CustomEvent", and inside the detail: Object we get a message saying "Could not serialize a data point."error.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Anyways, it would be very good with a detailed documentation update. As developers we spend a lot of time with trial and error.

 

We are in the same situation, can you please provide more details on how you acheived this event?

Hi,  I'm having the same issue.  Would you mind posting how you caught the event?

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.