How to get the All Selected Values from a Slicer using DAX in Power BI | Power BI Blog


How to get the All Selected Values from a Slicer using SelectedValue, AllSelected, and ConcatenateX Functions in Power BI
Scenario :
Suppose we have a Slicer having the MonthNames created from the Table ‘Calendar’ MonthName Field.




Extracting single Selected Value from the above Slicer :
We can use the SELECTEDVALUE () Function to extract the single selection value from the above Slicer.
SelectMonth = SELECTEDVALUE(‘Calendar'[MonthName])


Result:


Extracting multiple Selected Values from the above Slicer :

Suppose if we wants to extract the multiple values selected in the Slicer, we can achieve this by using the combination of CONCATENATEX() and ALLSELECTED() Function as defined in the following..

MultiSelect = IF(ISFILTERED(‘Calendar'[MonthName]), CONCATENATEX( ALLSELECTED(‘Calendar'[MonthName]),’Calendar'[MonthName],”,”),“(All)”)

Result:



Note : 
The above function will works for single selection as well.

——————————————————————————————————–

Thanks, TAMATAM ; Business Intelligence & Analytics Professional

——————————————————————————————————–



Source link

Be the first to comment

Leave a Reply

Your email address will not be published.


*