cancel
Showing results for 
Search instead for 
Did you mean: 
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.

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors