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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
agudis
Regular Visitor

Filter a column by the current row value of that column

I have a column of dates (not continuous)

 

File Date
4/10/2023
4/3/2023
4/6/2023
4/1/2023
4/25/2023
3/21/2023

 

I want to make a calculated column that returns the latest date in the column that is before than the current file date.

File DatePrevious Date
4/10/20234/6/2023
4/3/20234/1/2023
4/6/20234/3/2023
4/1/20233/21/2023
4/25/20234/10/2023
3/21/2023BLANK

 

However I can't figure out how to filter a column by value in it's own row without creating a circular dependency. In my code below, is there a way to make 'Table1'[File Date] refer to the [File Date] column on the left, and the current row value on the right?

Previous Date = CALCULATE(
        MAX('Table1'[File Date]),
        'Table1'[File Date] < 'Table1'[File Date]
    )
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @agudis 

try like:

Previous Date =
VAR CurrentDate = Table1[Date]
RETURN
MAXX(
    FILTER(
        Table1,
        Table1[Date]<CurrentDate
    ),
    Table1[Date]
)

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @agudis 

try like:

Previous Date =
VAR CurrentDate = Table1[Date]
RETURN
MAXX(
    FILTER(
        Table1,
        Table1[Date]<CurrentDate
    ),
    Table1[Date]
)

Works great, thank you!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.