cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jagvdelsen
Regular Visitor

How to use the SelectionIdBuilder to select all matching values on drilled categorical data?

Hi,

We are currently implementing a custom visual that supports multiple categories on a categorical slot. When drilling down to the lowest level, we would like to be able to select all matching categories by clicking one of the categorical values (For a working example on this functionality see the Microsoft Clustered Bar visual).

Let's assume we have the following data mapped:
Categories: Year, Region, Products
Values: Profit

Then the drilled down (lowest level) stacked categorical axis could potentionally look as follows:
2010 - East - Product A
2010 - West - Product A
2010 - North - Product A
2010 - South - Product A
2011 - East - Product B
2011 - West - Product B
2011 - North - Product B
2011 - South - Product B

In this case we would like to select/highlight Region East (matching all "East region" entries) when clicking on one of the East labels. The SelectionIdBuilder accepts the DataViewCategoryColumn and an index. The only index that can be specified is the value index (which does not result in the desired behavior).

 

As far as we know there is currently no way to achieve this, so any help would be appreciated!

Thanks in advance,
Jelle van den Elsen

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @jagvdelsen ,

 

I suggest you to create an unrelated DimRegion table for slicer and use a measure to filter your visual.

Here I create a sample to have a test.

vrzhoumsft_0-1686537045920.png

Data model:

vrzhoumsft_1-1686537091162.png

Measure:

Filter = 
VAR _SELECTREGION = VALUES(DimRegion[Region])
VAR _PRODUCTLIST = CALCULATETABLE(VALUES('Table'[Products]),FILTER(ALL('Table'),'Table'[Region] IN _SELECTREGION))
RETURN
IF(MAX('Table'[Products]) IN _PRODUCTLIST,1,0)

Add this measure into visual level filter and set it to show items when value = 1.

vrzhoumsft_2-1686537131993.png

 

Best Regards,
Rico Zhou

 

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

 

Hi Rico Zhou,

Thanks for your reply.

We are developing a Custom Visual using the Visuals API (visual-api). The SelectionIdBuilder is one of the aspects of this API (selection-api) and we would like to find out how the API for this class works in combination with drilling. This does not have any connection to the solution you provided which lies more on a data level.

Hope this helps!
Jelle.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.