Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Default setting by opening report

Hi,

 

We have a report with a few slicers (3) that can be changed.

One of the slicers is a date slicer to choose between the months. Now when you save and publish it to the service, by opening you always see the options when you saved it.

Can we change it that users always see the last month for example? So it change throught the year?

 

kind regards,

Davina

  • Hello Anonymous 

     

    You can do something like this

     

    Default Month Slicer =
    IF (
    MONTH ( NOW () ) = MONTH ( Dates[Date] )
    && YEAR ( NOW () ) = YEAR ( Dates[Date] ),
    "Current Month",
    Dates[Year-Month]
    )

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and I would love to see your like Or

     

    If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick implemented solution.

     

    Regards

    Kumail Raza

9 Replies

  • Kumail's avatar
    Kumail
    Icon for Impactful Individual rankImpactful Individual

    Hello Anonymous 

     

    You can do something like this

     

    Default Month Slicer =
    IF (
    MONTH ( NOW () ) = MONTH ( Dates[Date] )
    && YEAR ( NOW () ) = YEAR ( Dates[Date] ),
    "Current Month",
    Dates[Year-Month]
    )

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and I would love to see your like Or

     

    If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick implemented solution.

     

    Regards

    Kumail Raza

  • hey, 

    theres a option when you put a field on the filter pane (if its a date field) thats called relative filter (appears in a dropdown on the field filter on the filter pane), there you do have the option to filter by month you select the one called last X month and specify 1 month. 

     

    now for making it work for the last month them you will need to make a little dax that get the current month first day -1 and use that field for the relative filter if. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    StefanoGrimaldi& Kumail Thanks for your feedback, but this is a filter. I'm using slicers, so if I add this to the slicer or at any other visual it will always show last month. Meaning of our reports is opening in default value of last month, but also the possibility to change to an other month.

    • Kumail's avatar
      Kumail
      Icon for Impactful Individual rankImpactful Individual

      Anonymous 

       

      Yes, this will give you current month and you can keep it as default slicer when publishing. The user will also have option to change slicer to other months if that is allowed in the published report.

       

      If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.

       

      Hope this helps. 

       

      Regards

      Kumail Raza

  • Anonymous's avatar
    Anonymous
    Not applicable

    KumailThanks, it works today.

    Now i see the current month for june, but is it also possible to see both "current month" and "june"?

    • Kumail's avatar
      Kumail
      Icon for Impactful Individual rankImpactful Individual

      Anonymous 

       

      Please consider Accept it as the solution to help the other members find it more quickly and consider like if it helped you!!

       

      Regards

      Kumail Raza

      • Anonymous's avatar
        Anonymous
        Not applicable

        Kumailit works but I had another question in my previous reply.

        If you can answer this one, I can accept this.

         

        Question: Now i see the current month for june, but is it also possible to see both "current month" and "june"?