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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.