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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Olsman
Regular Visitor

Custom context menu event not triggered with certain types of filters condition operators

Hello

 

We are using Power BI embedded to display reports, and we have implemented a custom context menu for our visuals. It's working fine except when certain filters are applied.

 

If I apply an advanced filter with "is empty" or "is not empty" the context menu event is never triggered. But if I change to "is blank" or "is not blank" it's working.

 

  const newSettings = {
                extensions: [
                    {
                        command: {
                            name: "myCustomCommand",
                            title: "My custom command",
                            extend: {
                                visualOptionsMenu: {
                                    title: "My custom command",
                                }
                            }
                        }
                    }
                ]
            };

            report.updateSettings(newSettings).then(function () {
                report.off("commandTriggered");
                report.on("commandTriggered", function (event) {
                    let commandDetails = event.detail;
                    if (commandDetails.command == 'myCustomCommand') {
                        // do stuff
                    }
                });
            });
4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @Olsman ,

 

Null is the absence of a value ,also the blank ‘cells’ that can be any number of things like an empty text string (2 double quote signs).

Maybe the cells without values in this column are blank instead of null. You can check the cells without values in this column in the query editor and replace them with null or blank.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Liang

 

I think the filters are applied correctly, the question is why are the filters affecting the context menu.

 

If I have applied a filter with "is empty" or "is not empty" the custom context menu is not working.

 

Best regards,

Olle Karlsson

 

Hi @Olsman ,

 

The context menu is controlled by the main window, and the visual menu only has the option of the menu (by passing the option of the selection ID to trigger the enabling of the data point function for the end user). Getting information or events from this menu (for example, apply filter then callback the context) is not currently supported

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Liang

 

I don't think I describe the problem in a good way 🙂

 

1. Load the report

2. Open the context menu on a visual

3. Click on my custom context menu item

4. The javascript event is triggered 😀

5. Apply an advanced filter with "is empty"

6. Open the context menu and click on my custom item

7. The javascript event is not triggered ☹️

8. Change the filter to "is blank"

9. Open the context menu and click on my custom item

10. The javascript event is triggered 😀

 

Best regards

Olle Karlsson

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.