Forum Discussion

adityavighne's avatar
adityavighne
Icon for Continued Contributor rankContinued Contributor
6 years ago
Solved

Always select previous completed month page level filter

Hi Team,

 

I want page level filter which auomate the process of selection month which is previous completed month.

e.g. Current month is May 2020.

But I want page level filter who can select April 2020 whenever data udpates.

 

righ now i have manual selection of year and month.

 

Regards,

Aditya Vighne

  • v-kelly-msft's avatar
    v-kelly-msft
    6 years ago

    Hi  adityavighne ,

     

    Have you checked my reply?

     

     
    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

4 Replies

  • adityavighne , you can create a column like this and use in filter

     

    Month Name =
    var _mm= datediff([date],eomonth(today(),0),month)
    return
    switch( true(),
    _mm =0, "Current Month",
    _mm =1, "Last Month",
    format([Date],"MMM-YYYY")
    )

    Month year Sort = format([Date],"YYYYMM") // Optional if you want show in ui.

     

    • adityavighne's avatar
      adityavighne
      Icon for Continued Contributor rankContinued Contributor

      amitchandak 

      I'm not looking for this. I want my report always select completed month.

      e.g. right now May is running so I want my report must show default data of April which is completed month. Also on 1st June it changes to May

       

      regards,

      Aditya

      • v-kelly-msft's avatar
        v-kelly-msft
        Icon for Community Support rankCommunity Support

        Hi  adityavighne ,

         

        Have you checked my reply?

         

         
        Best Regards,
        Kelly
        Did I answer your question? Mark my post as a solution!
  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi adityavighne ,

     

    I guess you have a date table,right?

    Then create 2 calculated columns as below:

     

    Date Month is = IF(YEAR('Date table'[Date])*100+MONTH('Date table'[Date])=YEAR( EDATE(TODAY(),-1))*100+MONTH( EDATE(TODAY(),-1)),FORMAT('Date table'[Date],"MMMM"),BLANK())
    Date Year is = IF(YEAR('Date table'[Date])=YEAR( EDATE(TODAY(),-1)),FORMAT('Date table'[Date],"YYYY"),BLANK())

     

    Finally you will see:

    For the related .pbix,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!