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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jprmsn
Frequent Visitor

SelectionIdBuilder withmatrixnode hiearchy

I'm struggling with setting the correct selection Ids to use with row selection, drill-though, and report page tooltips with my custom matrix visual.

 

Right now, I am creating IDs using .withMatrixNode and then passing an array of them to these functions.  Here's an example for a matrix row with two categories set:

0: e

dataMap: dim HealthSystem.Health System: [{…}]

key: "{"dim HealthSystem.Health System":[{"identityIndex":24}]}[]"

measures: []

 

1: e

dataMap: dim Facility.Facility: [{...}]

key: "{"dim Facility.Facility":[{"identityIndex":25}]}[]"

measures: []

 

When I call (for example selectionmanager.select) more than one selection ID (e.g. two categories), I get a message on my crossfiltered visuals that says: “We can’t display this visual because a measure is used in cross highlighting.  Please remove the measure or cross highlight”. None of my selection IDs include measures.

 

I need to be able to select multiple categories to  correctly filter my other visuals and also to be able to set the context for report page tooltips.  The stock matrix is able to do this, but I don't know what the selectionIds look like.

 

I couldn't find any matrix samples that handle a hierarchy.  Can anyone give me a steer?

Thanks.

John

1 ACCEPTED SOLUTION
jprmsn
Frequent Visitor

The key here is to stack calls to the builder and not call createSelectionId until done.  So, for example, you can call .withMatrixNode for a row node, another row node, then a column node, then call create and you will end up with a Selection ID for the "intersection" of the two rows and the column.

View solution in original post

2 REPLIES 2
jprmsn
Frequent Visitor

I see from debugging a stock matrix that their should be a single selection ID that looks like this:

"{"comp":{"k":0,"l":{"col":{"s":{"e":"Table1"},"r":"Field"}},"r":{"const":{"t":1,"v":"Table2"}}}}"

 

That look familiar to anyone?  Trying to figure out how to construct it.

Thanks.

John

jprmsn
Frequent Visitor

The key here is to stack calls to the builder and not call createSelectionId until done.  So, for example, you can call .withMatrixNode for a row node, another row node, then a column node, then call create and you will end up with a Selection ID for the "intersection" of the two rows and the column.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.