Forum Discussion

monicajsv's avatar
monicajsv
Frequent Visitor
2 years ago

Relative date filtering

I have a list of elements with a planned end date and I would like to do a relative filtering of the date in the visualization to only show those whose end date is greater than or equal to 6 months ago and those that have a date in the future, I am using a slicer with relative date style, but it only allows me to see those of the last x months, those of the next months or those of the current month, I do not see an option that allows me to do what I want to show from a relative date in forward including those of the future, do you have any idea how I could do it?

Thanks in advance!

10 Replies

    • monicajsv's avatar
      monicajsv
      Frequent Visitor

      Thanks for your reply, but this options don't resolve what I would like to filter

      • some_bih's avatar
        some_bih
        Community Champion

        Hi monicajsv so you want to control some end of months in past / future? If yes, what is reference date, previous month or...share example with output

  • some_bih's avatar
    some_bih
    Community Champion

    Hi monicajsv possible solution as following

    If you need measure then it could be like:

    Measure test=
    CALCULATE (

    SUM(Yourtable[somecolumn]),

    DATESINPERIOD (
            'Date'[Date],           -- Your Date key column
            TODAY(),                -- Today
            -6,                      -- the set needs to contain 6
            MONTH                   -- months
        )
    )
     
    DAX function DATESINPERIOD

    https://learn.microsoft.com/en-us/dax/datesinperiod-function-dax?WT.mc_id=DP-MVP-4025372

     

    Did I answer your question? Kudos appreciated / accept solution!

     

    • monicajsv's avatar
      monicajsv
      Frequent Visitor

      Hello,

      I don't need a measure, I just want to be able to filter them.

      Thanks for your help, I think I'll use a colum to calculate if the date is within the relative period I need and the use this column to filter.

      Regards,

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI monicajsv,

        Maybe you can try to add a calculated column to compare with current date and table date to map records with period tags. Then you can use this field on filter to filter your visual records based on period tags.

        Regards,

        Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi monicajsv ,

    Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

    If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng