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
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

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
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.

Users online (1,584)