Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 always. It is working randomly. I also didn't find any example showing the full working code for this. Could anyone help on this by providing the working code for this.
I tried the below inside the report loaded event. I also tried attaching the event listener for slicer but that didn't worked too.
report.on("selectionChanged", function (event) {
console.log(event);
});
Please help!!
Solved! Go to Solution.
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
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
Thank you for the response @Anonymous . Will try this
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
8 | |
7 | |
4 | |
4 | |
4 |