Forum Discussion
DAX Measure Not Showing Correct Slicer State (All Selected, No Selection, Partial Selection)
- 1 year ago
Hi chetan8080 ,
Thanks for the response.
Could you please provide sample data that fully represents the issue or question you're referring to? Kindly ensure the data is in a usable format (e.g., PBIX,Excel or CSV) rather than a screenshot, and does not contain any sensitive or unrelated information.
Looking forward to your response.
Best regards,
Lakshmi.
Hi, then i would suggest disabling 'Select All' and use below sample code
Display =
VAR _SelectedRegions =
VALUES('Table'[REGION])
VAR _SelectedRegionsCount =
COUNTROWS(_SelectedRegions)
VAR _TotalRegionsCount =
COUNTROWS(ALL('Table'[REGION]))
VAR _IsFiltered =
ISFILTERED('Table'[REGION])
VAR _result=
SWITCH(
TRUE(),
NOT _IsFiltered || _SelectedRegionsCount = 0,
"Please select a region",
_SelectedRegionsCount = _TotalRegionsCount,
"All regions selected",
"Regions selected: " &
CONCATENATEX(
_SelectedRegions,
'Table'[REGION],
", "
)
)
RETURN _result
Hello MasonMA
this dax is not working as expected see below picture
When I select all it should show "All Regions Selected"
- MasonMA1 year ago
Super User
As i mentioned in last message, you would first need to disable using 'Select All' from Filter setup. because when 'Select All' is unchecked, it basically means everything is selected.
- chetan80801 year ago
Helper II
Hi MasonMA , I need to keep that "Select All" from filter setup, Is it possible to achieve to what I need with the keeping the "Select All" option enabled?
I have other slicers where they have too many values in slicers to select, so I cannot disable using "Select All" from filter.- MasonMA1 year ago
Super User
Then i'd suggest using the first solution and educate your end users. Because from logic point of view, when 'Select All' is unchecked/nothing is selected, your message is supposed to display 'All region is selected' as this is actually the way your filter contexts applied on your report. correct?