Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Select all months to current button

Hi everyone,

 

I would like a button that allows the user to select all months to the current month in a slicer of months.

 

Any idea how this might be achieved? I have a typical calendar table with month numbers and names etc so I am sure something like this is possible, I just have no idea how I would get it into a bookmark and then a button?

 

Cheers,

Scott

  • Anonymous , You can create a bookmark after selecting all in the slicer. That should help

  • Hi, Anonymous 

     

    You can try my method.

    Date = CALENDAR(DATE(2021,1,1),DATE(2021,12,31))
    Month = MONTH([Date])

    Measure =
    IF ( SELECTEDVALUE ( 'Table'[Month] ) >= SELECTEDVALUE ( 'Date'[Month] ), 1, 0 )
    

    Add Measure to the Filters on this visual.

    Create a new table.

    Table = VALUES('Date'[Month])
    

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    You can try my method.

    Date = CALENDAR(DATE(2021,1,1),DATE(2021,12,31))
    Month = MONTH([Date])

    Measure =
    IF ( SELECTEDVALUE ( 'Table'[Month] ) >= SELECTEDVALUE ( 'Date'[Month] ), 1, 0 )
    

    Add Measure to the Filters on this visual.

    Create a new table.

    Table = VALUES('Date'[Month])
    

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous , You can create a bookmark after selecting all in the slicer. That should help

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      I need it to dynamically only select all months to the current month though. 

       

      Cheers,

      Scott

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Anonymous , if want to create a selection like a current month or all month before current, then you need to create a column like this example and select a value and save

         

        Month Type = Switch( True(),
        eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
        eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
        Format([Date],"MMM-YYYY")
        )