Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Setting a default values in slicer based on months

Hi Guys,

 

I have a scenario wherein the selected value in the slicer has to be the current month and previous month. For example, if the users are checking currently, Sep 2020 and Aug 2020 has to be the default selections. In the next month, it has to be Oct 2020 and Sep 2020. 

 

The below displayed is the data for reference.

 

MonthSales
Jan-20$1,346,931
Feb-20$242,824
Mar-20$1,543,120
Apr-20$286,320
May-20$1,296,335
Jun-20$1,991,486
Jul-20$1,237,445
Aug-20$680,516
Sep-20$1,284,505

 

Thanks for the help!

4 Replies

  • Anonymous , In you date table you need to have a column like this and select "Last 2 Months". Month year is column you already have for month year

     

    Month Type = Switch( True(),
    Date([Date]) >= eomonth(Today(),-2)+1 && Date([Date])<= eomonth(Today(),0),"Last 2 Months" ,
    [Month Year]
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank Amit! But, the client wants to see the name of months in Slicer. If i use the solution that you gave, i will be seeing "Last two months" and name of other months as items in the slicer. amitchandak