Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I have a slicer with two values: "Accounting Date" and "Effective Date". How to always keep one value selected, NOT both selected or NOT both unselected.

On a screenshot below selected "Effective Date"

image

The slicer has "Single select" on, but I still able to select both values.

And now both values unselected. That's what I am trying to prevent.

enter image description here

I created to measure "DateTypeSelected" using  SELECTEDVALUE but I dont think you can use measure in a slicer.

DateTypeSelected = SELECTEDVALUE('Date Type Slicer'[Date Type],"Effective Date")

1 Answer

0 votes
by (47.2k points)
  • Currently there is no solution to this but to mitigate the problem, you can safeguard your measures from showing incorrect results, or display an error message if the user makes an invalid selection.

  • Create a measure like this, which will return TRUE if only a single value in the slicer is selected:

IsValidDateType = COUNTROWS(VALUES('Date Type Slicer'[Date Type])) = 1

  • And then you can adjust your measure like this:

MySum = IF([IsValidDateType], SUM(fact[value]), BLANK())

  • And you could create an error message measure like this, which could be added to a card to inform the user of invalid selection:

DateTypeErrorMsg = IF([IsValidDateType], " ", "Please select one, and only one, value for Date Selection.")

Related questions

0 votes
1 answer
asked Nov 30, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer
...