Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filter a report using query string for relative dates

Hi,   Is there a way pre-filter dates? I want my data to get filtered by rolling 30 days.  I want the user to have an option to change the filter if needed and look for broader time period. But by...
  • v-lionel-msft's avatar
    6 years ago

    Hi Anonymous ,

    How about to use filter on this visual?

     

     

    Days = 
    VAR x = 
    CALCULATE(
        LASTDATE('Table'[Date]),
        ALL('Table'[Date])
    )
    RETURN
    DATEDIFF(
        MAX('Table'[Date]),
        x,
        DAY
    )

     

     

    Even if your data is updated daily, only the last 30 days will be displayed.

    If you want to display longer data, you need to modify the filter.

     

    Best regards,
    Lionel Chen

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