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.
Hello everyone, I hope you’re doing well.
I have a query for you, I’m trying to add a right click option in some svg circles, the main idea Is to click on that option and open a power bi page existing in the same power bi report
Similar to the Drill through option in some power bi charts…
Do you think this functionality is achievable?
I'm not sure that this feature is supported by Power BI Custom Visuals
Please let me know any advice. I appreciate your help.
Thank You and Best Regards.
Hi @Anonymous,
This would not be psosible using the context menu API, as this action is delegated to the main Power BI window to provide what options can be displayed in here.
The only way I can think of doing this is to build your own context menu functionality (example). However, the only way to currently open another page would be via a hyperlink, which means you would need to know the URL of the target page. Hyperlinks also have to be delegated to Power BI to handle - which would prompt the user, and open them in a new window - and is not particularly elegant.
I think that the ideal solution would be for custom visuals to have access to the inbuilt Action menu options, similar to core shapes and buttons, which would open up page links and other actions such as bookmarks, which would be pretty neat also. I'd suggest opening an issue here to request it.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hello there, thank you for the reply.
I've added the drillthrough option on the svg circle, based on this:
//handle context menu this.svg.on('contextmenu', () => {
const mouseEvent: MouseEvent = d3.event as MouseEvent;
const eventTarget: EventTarget = mouseEvent.target;
let dataPoint = d3.select(eventTarget).datum();
this.selectionManager.showContextMenu(dataPoint? dataPoint.selectionId : {}, {
x: mouseEvent.clientX,
y: mouseEvent.clientY
});
mouseEvent.preventDefault();
});
But now I need to modify the items in the context menu, i want to hide show as table, copy, include, exclude options.
Is this possible? how can I modify the context menu items?
Please let me know any comment.
Thank You.
Hi @Anonymous,
You can't change the context menu items - this is populated from Power BI based on what it knows about your request.
The only 'customisation' you can do is whether to supply the context menu a selection ID for the current target. If valid this will display the Include, Exclude and Drill through options if one of the fields or measures in your selection ID matches any added to a drillthrough page in your report. Copy and Show as a table are always displayed.
You cannot manipulate the context menu via HTML/JS, as it is not added to your custom visual's DOM - it is part of the main Power BI window, which is inaccessible to the developer visual sandbox.
If you want more options here, I'd suggest you create a feature request for it with the team and hopefully they can add it to their backlog.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |