Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get values from filter using a measure

I have a filter with relative date applied to a visual / page and I would like to display selected period on the report, so it can change dynamically.

Is there a way to get relative filter values (dates) using DAX?

Thanks!!

  • Hi, Anonymous 

    You need to create a consecutive calendar table.

    Then you can use 'Min'/'Max' to get the earliest/ latest date in relative date slicer and disply them in each card.

    Earliest date = Min('Calendar'[Date])
    latest date = MAX('Calendar'[Date])

    You can also concatenate the results as follows in a single card.

    Date Range = FORMAT( MIN('Calendar'[Date]),"yyyy-dd-mm")&"~"&format(MAX('Calendar'[Date]),"yyyy-dd-mm")

    Best Regards,
    Community Support Team _ Eason

3 Replies