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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
arhomberg
Helper I
Helper I

Determine most recent day in list for each month in a year

Hello Everyone,

 

I have a table that has a list of dates, and I would like to create a new column that goes through and finds the most recent date listed within every month for each year.

 

Here is an example of what I would like to do:

arhomberg_0-1625673312459.png


2/10 is the most recent day listed in Feb of 2020 so it receives a 1 and March 31 is the most recent day in March of 2020 so it receives a 1.

Any advice would be greatly appreciated, thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

[Is Most Recent...] = // calculated column
var CurrentDate = T[Date to Check]
var MonthStart = EOMONTH( CurrentDate, -1 ) + 1
var NextMonthStart = EOMONTH( CurrentDate, 0 ) + 1
var Result =
    CurrentDate = MAXX(
        filter(
            T,
            MonthStart <= T[Date to Check]
            &&
            T[Date to Check] < NextMonthStart
        ),
        T[Date to Check]
    )
return
    1 * Result

View solution in original post

1 REPLY 1
Anonymous
Not applicable

[Is Most Recent...] = // calculated column
var CurrentDate = T[Date to Check]
var MonthStart = EOMONTH( CurrentDate, -1 ) + 1
var NextMonthStart = EOMONTH( CurrentDate, 0 ) + 1
var Result =
    CurrentDate = MAXX(
        filter(
            T,
            MonthStart <= T[Date to Check]
            &&
            T[Date to Check] < NextMonthStart
        ),
        T[Date to Check]
    )
return
    1 * Result

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.