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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dancarr22
Helper V
Helper V

DAX to get MIN/MAX date from a slicer but ignoring date in matrix

Hello,

 

The slicer and the matrix in the screenshot below both reference the same date table.  The Date table has every day between 1/1/1995 to 12/31/2024.

How can I get the MIN and MAX date from the AsOfDate slicer and reference in the matrix?  If I just calc min/max date it only displays MIN/MAX for the current year - as is grouped in the matrix.  If I use ALL it removes all filters and doesn't even use the slicer filter dates.  So, I'd want the calc to display (MIN) 5/13/2006 in every cell in the matrix - and MAX of 3/20/2019.

This is needed for financial calcs we are performing.

 

Appreciate any assistance you can provide.

 

Thanks,

Dan

 

 

 

 

PBI_DateExample.JPG

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hello @dancarr22 

 

ALLSELECTED is your friend here 🙂


The expression

CALCULATE (
    MIN ( 'Date'[Date] ),
    ALLSELECTED ()
    -- or ALLSELECTED ( 'Date' )
)

evaluated at the "top level" of a measure used directly in the visual will return the minimum date ignoring filters due to grouping within the visual (roughly speaking), which in your case should be the minimum filtered on the slicer.


Similarly for max date.

 

See this article for a full discussion of ALLSELECTED:

https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/

 

Does this work for you?

 

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hello @dancarr22 

 

ALLSELECTED is your friend here 🙂


The expression

CALCULATE (
    MIN ( 'Date'[Date] ),
    ALLSELECTED ()
    -- or ALLSELECTED ( 'Date' )
)

evaluated at the "top level" of a measure used directly in the visual will return the minimum date ignoring filters due to grouping within the visual (roughly speaking), which in your case should be the minimum filtered on the slicer.


Similarly for max date.

 

See this article for a full discussion of ALLSELECTED:

https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/

 

Does this work for you?

 

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thanks @OwenAuger !!!  That worked

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.