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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Get the value of a non-numerical disconnected slicer

Hello everyone,

 

My question is : what is the simplest way to get the value of a non-numerical disconnected slicer in a DAX measure?

 

Disconnected tables are very useful to sensitize or perform data modelling. And it is pretty easy to create a DAX measure which computes the value choosen by the user in this disconnected table (with a MIN, MAX or Average if more than 1 value is selected in the disconnected slicer).

 

But how does it work for non-numerical disconnected tables ?

For example, let's say that I have a disconnected table with 1 column - 3 rows : "Red", "Blue", "Green".

I would like a DAX measure to be able to store the value (supposed to be unique here) defined by the user when using this disconnected table as a slicer in a report.

 

Thanks a lot !

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

Hi @Datatouille

 

Try this

 

NewMeasure = VALUES(SlicerField)

 

 




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

Hi @Datatouille

 

Try this

 

NewMeasure = VALUES(SlicerField)

 

 




Lima - Peru

Hi @Vvelarde

 

Many thanks for your reply. I didn't know this function ! Very useful.

My Final measure is :

 

Measure= If ( Countrows (Disconnected_Table) = 1 ; Values (Slicer_Column) ; "").

 

I used an If statement in case where the user selects more than 1 item in the Slicer_Column (colors here).

 

Thanks again.

Well actually, ' HasOneValue() ' performs the same task but is much better than ' Countrows (Disconnected_Table) = 1 ' in terms of performance

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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