Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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!!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

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

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

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

Anonymous
Not applicable

That's exactly what I was trying to do. Didn't think about using MAX and MIN.

Thank you @v-easonf-msft !!

amitchandak
Super User
Super User

@Anonymous , You can do that with an independent date table and period slicer

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-30/m-p/1284966#M561629

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Users online (7,368)