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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.