Tuesday, October 1, 2019

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

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
--------------------------------------------------------------------------------------------------------

3 comments:

Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.