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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jagvdelsen
Frequent 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

3 REPLIES 3
jagvdelsen
Frequent Visitor

Is there anyone who can answer this question please? As the previous answer did not help us to get our problem resolved and I did not get any response after that anymore.

Thanks!

Anonymous
Not applicable

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.