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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ELW
Advocate II
Advocate II

DAX Distinct dates, filtered before today

I have a table with dates in it.  I want to create a new table from a unique list of dates, but have it filtered for dates before today.  I am able to get the new table with = DISTINCT('Date'[Date]) but I can't figure out how to filter it for before today.  

 

For example:  

Date
2/28/2021
3/3/2021
3/5/2021
7/22/2021
7/22/2021
12/18/2021
5/27/2022
5/27/2022
6/27/2022
8/14/2022
8/14/2022
8/17/2022
12/23/2022
12/23/2022

 

What I want (distinct and before today):

Result
2/28/2021
3/3/2021
3/5/2021
7/22/2021
12/18/2021
5/27/2022
6/27/2022
8/14/2022
8/17/2022

 

Thanks in advance, this seems like it should be simple and I can't get it to work!  

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

[Your Table] =
var tooday = TODAY()
return
  FILTER(
    DISTINCT( T[Date] ),
    T[Date] <= tooday
  )

View solution in original post

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

[Your Table] =
var tooday = TODAY()
return
  FILTER(
    DISTINCT( T[Date] ),
    T[Date] <= tooday
  )

Beautiful, thank you!!  I appreciate your fast response, you're living up to your username!  🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors