Forum Discussion

sarikei's avatar
sarikei
Helper I
3 years ago

Selection from Slicer

Hi,

 

  1. I have a Slicer defined in my report, it displays a list of predefine Date. i.e. This Month, Last Month, This Year, Last Year.
  2. I want to create the Measure to check if the selected value is “This Month”, then do something, else if the selected value is “This Year”, then do something, else do nothing. How can I do this?

 

Thanks in advance.

6 Replies

  • MAwwad's avatar
    MAwwad
    Solution Sage

    Hello,

     

    Logic as : If the value selected is = "This Month" then return 1 

                    Else Return 0

    Try this:  If(Value(Date) = "This Month",1, If(Value(Date) = "This Year",2,etc.....

     

    Or you can use SWITCH Case

     

    Dont forget to accept this as a solution if it helped you 🙂

    • sarikei's avatar
      sarikei
      Helper I

      Thanks JorgePinho, Yes, I got it work as following!

       

      MySelection  = IF(

          SELECTEDVALUE(DateTable[Date Selection]) = "This month",

          "Yes","No"

      )

       

       

      Now, instead of “Yes”, if the selection is “This month”, I actually want to read the “From – To” date value from the other Slicer. And then group them together. Then I will use this measure in the other visual (bar chart). I know how to read the “From – To” value using:

       

      MIN(DateTable[Date Selection])

      MAX(DateTable[Date Selection])

       

      But how can group all the value from this??

       

      Many thanks.