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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CaveOfWonders
Helper IV
Helper IV

Variable that dynamically returns the date of the last Thursday of the current month

Hi Community,

Is it possible to create a variable within a measure that returns the date of the last Thursday of the current month dynamically, so for example, we are now in October 2022 and the date of the last Thursday of this month is 27th October 2022. Next month it will be 24th November 2022 etc.

Preferably, this would be calculated independant of any tables if possible?

1 ACCEPTED SOLUTION
CaveOfWonders
Helper IV
Helper IV

Figured it out:

 

VAR __Start = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR __END =   EOMONTH ( TODAY (), 0 )
VAR __LastThursdayofCurrentMonth =
    MAXX (
        FILTER (
            ADDCOLUMNS ( CALENDAR ( __Start, __END ), "Day", WEEKDAY ( [Date] ) ),
            [Day] = 5
        ),
        [Date]
    )

View solution in original post

2 REPLIES 2
CaveOfWonders
Helper IV
Helper IV

Figured it out:

 

VAR __Start = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR __END =   EOMONTH ( TODAY (), 0 )
VAR __LastThursdayofCurrentMonth =
    MAXX (
        FILTER (
            ADDCOLUMNS ( CALENDAR ( __Start, __END ), "Day", WEEKDAY ( [Date] ) ),
            [Day] = 5
        ),
        [Date]
    )
Anonymous
Not applicable

i

 

If you have a date table make sure that you have the Weekday number (Weekday(Date[date])

and after the measure is :

calculate(max(date[date]), Weekday=4)

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.