Forum Discussion

kkalyanrr's avatar
kkalyanrr
Icon for Helper V rankHelper V
5 years ago

Setting month filter to current month by default

Hello,

I'm having a report page with year and month filters,Is there any way I can set up this page in a way that it shows current month selected by default(not through relative date filtering last 1 month ).
I cannot use relative date filtering..coz at times client wants to compare 2 months at a time of same year or different years like
Mar2020 and May 2020 comparison or Mar2020 and Mar 2018 comparison.

3 Replies

  • kkalyanrr,

     

    Foelr always keeping the current month as a default, I suggest to create calculated column using IF. 

     

    Something like this. 

    If(table[month] =max(table[month]), "current month", table[monthname])

     

    Regards, 

    Manikumar 

  • kkalyanrr , You have to create a column like this in you date table

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

    and use this to select This Month. You can sort this on month year sort

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

    Hi kkalyanrr ,

    As far as I know, currently set the default slicer value as current month could not supported directly in power bi desktop, maybe you can refer the following simliar issues to try:

    1. How to set slicer default value of current month? 
    2. Slicer to select current month as default  
    3. How to show/set slicer to current month 

     

    Best Regards,
    Yingjie Li

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