Forum Discussion
Capture selected value from multiple slicers on same column
- 6 years ago
Oh so you have changed the filter interactivity to block the slicer from affecting the other matrix. In this case you can do this by setting the conditional formatting on the matrix to a measure that uses SELECTEDVALUE.
First create a measure for your title:
Dynamic Title = "Matrix for " & SELECTEDVALUE('Fact'[Account],"Unknown")Then Click on the matrix, go into the title property and hover over the text fields until the "three dots" option appears and then click that to get into the conditional formatting dialog
Then choose the measure you created as the field for the Title text.
tomtang wrote:
Because I know even if I use "SELECTEDVALUES", the DAX can't capture any value from the slicers.
I'm not sure why you would say this. If the slicers are single select then SELECTEDVALUES should work just fine.
If they can be multi-select you would have to use an expression like CONCATENATEX( VALUES( <column> ) , <column>, ",") to get the list of selected values.
Thanks for replying.
The reason is being because I have 2 similar matrices (e.g. Sales & Gross Margin) which link to 2 slicers (e.g. A & B slicers, these 2 slicers are referring to the same column) >>> Only single select for each slicer.
I want to capture A slicer's value and show the selected value on to 1st matrix (Sales) title, and B slicer for 2nd matrix separately and respectively.
So CONCATENATEX might not work for this case. Or not sure if CONCATENATEX can identify which selected value is from 1st slicer, and which is from 2nd slicer (even when 2 slicers within the same page are referring to the same column)?
Thanks a lot!
- d_gosbell6 years agoSuper User
tomtang wrote:
The reason is being because I have 2 similar matrices (e.g. Sales & Gross Margin) which link to 2 slicers (e.g. A & B slicers, these 2 slicers are referring to the same column) >>> Only single select for each slicer.
I can't think how you have this working. Are you able to create a simple example pbix report with dummy data and upload it?
If you have 2 slicers on the same underlying column they will cross filter each other by default so it would be impossible to select 2 different values. And even if you turn off the cross filtering, when you select 2 different values you will get no data as the 2 slicers will cancel each other out because the filter conditions get combined with a logical AND.
- tomtang6 years agoHelper III
Thanks for following up the question.
Kindly find the link for the sample file.
https://1drv.ms/u/s!AuUOyRlH3Y79g5FwcCn5WWhWpJcUJg
Thank you!
- d_gosbell6 years agoSuper User
Oh so you have changed the filter interactivity to block the slicer from affecting the other matrix. In this case you can do this by setting the conditional formatting on the matrix to a measure that uses SELECTEDVALUE.
First create a measure for your title:
Dynamic Title = "Matrix for " & SELECTEDVALUE('Fact'[Account],"Unknown")Then Click on the matrix, go into the title property and hover over the text fields until the "three dots" option appears and then click that to get into the conditional formatting dialog
Then choose the measure you created as the field for the Title text.