Forum Discussion

CMMkamil's avatar
CMMkamil
Frequent Visitor
4 years ago
Solved

How to set date filter to previous month?

Hello,

 

Probably very simple but I can't seem to find a way for the life of me. 

 

Basically I have two cards, one is showing the total profit in the current month(February) and I want the other to show the previous month so January in this case. But I want those to update automatically at months move on. 

 

For the first card I simply have the filter set to "Show items when the value: is in this month"

 

But how do I set it for the previous month i.e. January and not last 30 days?

 

Many thanks,

 

Kamil

5 Replies

  • You should have an option for the last "Calendar month".

    • CMMkamil's avatar
      CMMkamil
      Frequent Visitor

      It turns out that I'm just very blind. Sorry and thank you. 

      • AmberJane's avatar
        AmberJane
        Icon for Helper III rankHelper III

        Not at all! I got stuck on this too with week and month haha! 

  • Hi, 
    You can create new column in your calendar table to highlight previous month


    Period = Switch( True(),
    eomonth(Date[Date],0) = eomonth(Today(),-1),"Previous month" ,
    Format(Date[Date],"MM YYYY"))

    and then, when the date changes, previous month will move along. Simply use it as a filter for the card

  • ITManuel's avatar
    ITManuel
    Icon for Responsive Resident rankResponsive Resident

    Hi,

     

    you could apply the filter in the calculation not in the Filter pane.

     

    CALCULATE("Total profit"), PREVIOUSMONTH('Date'[Date]))

     

    Br