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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PbiCeo
Helper II
Helper II

How to get correct value selected by the slicer

Hello everyone,

I want to display values on Matrix selected by the slicer.

Here is Table1.

Selection
Group
Product1
Product2
Division
Person


and Table2.

NumDataGroupProduct1Product2DivisionPerson
1A11aCA1
2A23aCA1
3A32aBB1
4B15aBA1
5B24bAB1
6B32bAA1
7C11bAB1
8C23bBA1
9C35bCB1

 

There is no relationship between them.


For slicer selection, I created a measure like this:

SelectedValue = SELECTEDVALUE(Table1[Selection])

Moreover, measure to get value selected by the slicer:
Measure = SWITCH([SelectedValue],
"Group", DISTINCT('Table2'[Group]),
"Product1", DISTINCT('Table2'[Product1]),
"Product2", DISTINCT('Table2'[Product2]),
"Division", DISTINCT('Table2'[Division]),
"Person", DISTINCT('Table2'[Person]),
BLANK()
)
 
But I got an error when I selected a value from above "Selection" on the slicer:
MdxScript (Model) (9, 13) Calculation error in measure 'Table2'[Measure]: a table of multiple values was supplied where a single value was expected.
 
I want to disptaly each distinct corresponding value.
How to correct that?
Thank you,
Vadi
1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@PbiCeo Right, DISTINCT returns a table of values which is not valid for measures. Often you use CONCATENATEX to do something like returning a single value from a table of values. If that does not suffice Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.