Forum Discussion

EricH77's avatar
EricH77
Frequent Visitor
2 years ago
Solved

Slicer that excludes current month

I have a slicer currently that is based on client contract end dates.  We have contracts that have end dates going all the way into 2050.  I want to let my team use this slicer but limit it to only show everything that is prior to the current month.  I know I can manually set the slicer to exclude the current month but I don't want to have to update this manually every time we enter a new month.  How can I create a slicer that only shows contracts with end dates prior to the current month?

 

Thanks

  • Hi EricH77 

    Please a create a measure

     

    Till Current Month = 
    VAR _CurrentMonth = Month(Today())
    VAR _ContractEndMonth = Month('YourCalenderTable'[Date])
    RETURN
    If(
    _CurrentMonth < _ContractEndMonth, 1, 0
    )

     

     

    Bring this measure in Slicer filter page and set the value as 1.


    Let me know if that works for you


    If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

    Thanks
    Pijush
    Linkedin

2 Replies

  • PijushRoy's avatar
    PijushRoy
    Community Champion

    Hi EricH77 

    Please a create a measure

     

    Till Current Month = 
    VAR _CurrentMonth = Month(Today())
    VAR _ContractEndMonth = Month('YourCalenderTable'[Date])
    RETURN
    If(
    _CurrentMonth < _ContractEndMonth, 1, 0
    )

     

     

    Bring this measure in Slicer filter page and set the value as 1.


    Let me know if that works for you


    If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

    Thanks
    Pijush
    Linkedin

    • Decal's avatar
      Decal
      Helper I

      Is there a way to do this where we allow the user to decide whether they want to filter the current month out or not?  Sometimes for executive reporting they only want to go up to the last month, but may want to see current month for their own tracking.

       

      Note:  I can do this by adding a column in my calendar table.  I was trying to figure out a way to do it without adding a column and instead using a measure (possibly with a combination of a new table).