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
lucmax
Helper II
Helper II

Get selected item after filtering using context menu

Hi,

 

is there a way to get information about the selection that gets created when including/excluding a datapoint using a context menu?

We have a custom visual and need to know, if the user included/excluded a datapoint using the context menu so we can show a button to reset this selection.

 

Using the selectionManager.clear() method isn't working.

 

Best regards

4 REPLIES 4
dm-p
Super User
Super User

Hi @lucmax,

The context menu is governed by the main window and the visual only has the option to display it (with the option of passing a selection ID in order to trigger enable data point functionality for end users). There is currently no support for obtaining information or events (e.g. through callbacks) from this menu.

As you've probably observed, including/excluding data points will cause Power BI to employ a visual-level filter for those conditions. As this shown in the filter pane and is external to the visual's dataset there is no current way of telling that these filters are in-place from within a visual; an exception being if your visual is designed to work as a slicer (but then only knows about the filters it has explicitly set rather than those imposed by the main window or other slicers).

If you want to be able to determine this, then it would need to be a feature request. It could be worth framing this is to obtain details of any visual level filters that are applied to the visual as this might cover additional cases other than the context menu events. This might be seen as giving the visual more data than it should technically know about, but that's a call for MS. I would personally love to see some kind of feature parity with Power BI Embedded here, as it can create all kinds of potentially useful additions for visuals.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




v-shex-msft
Community Support
Community Support

Hi @lucmax,

Did this link help with your scenario? if that is the case, you can consider Kudo or accept this to help others who faced similar requirements.

If these also don't help, please share more detailed information for your requirements to help us clarify your scenario and test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft,

unfoutunatly it did not help. What we actually need to is either get the selected item when clicking on the filter buttons within the context menu, or to disable/hide the buttons when creating it. Maybe there is a way to disable/hide the buttons within the context menu?

 

Regards,

lucmax

v-shex-msft
Community Support
Community Support

Hi @lucmax,

I think you can check the following link about the data point selections on custom visual if it meets to your requirement:

Power BI visual data point selections - Power BI | Microsoft Docs
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.