Forum Discussion
JagadishNallami
2 years agoFrequent Visitor
Add event handler for selectionChanged event
I am working on some enbedded power bi report. From documentation I see we can listen for the changes made to a slicer selected values by selectionChanged event. I tried using that but is not working...
- Anonymous2 years ago
Hi JagadishNallami ,
Base on your description, it looks like you're trying to handle the 'selectionChanged' event for a Power BI embedded report and it is not working. Please change the codes as below and check if it can work...
// Attach event listener for the report loaded event report.on('loaded', function () { console.log('Report loaded'); attachSelectionChangedEvent(report); }); // Function to attach the selectionChanged event handler function attachSelectionChangedEvent(report) { report.on('selectionChanged', function (event) { console.log('Selection changed:', event); } );Best Regards
Anonymous
2 years agoNot applicable
Hi JagadishNallami ,
Base on your description, it looks like you're trying to handle the 'selectionChanged' event for a Power BI embedded report and it is not working. Please change the codes as below and check if it can work...
// Attach event listener for the report loaded event
report.on('loaded', function () {
console.log('Report loaded');
attachSelectionChangedEvent(report);
});
// Function to attach the selectionChanged event handler
function attachSelectionChangedEvent(report) {
report.on('selectionChanged', function (event) {
console.log('Selection changed:', event);
} );
Best Regards
JagadishNallami
2 years agoFrequent Visitor
Thank you for the response Anonymous . Will try this