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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
fareedice
Frequent Visitor

Dynamic weekend date

Hi

 

I have date table with dates from Year 2021 to 2025.

 

I want to create a dynamic measure, whenevr power BI report is opened by a user, then the date should display as last weekending date.. ( i.e last friday)

Suppose If i open the report today, the date should display as 9th December, If i open tomorrow, the date should display as  16th December. 

 

Could some one help how to acheive this

6 REPLIES 6

Try this instead, Last Friday = CALCULATE( MAX([Date]), FILTER( ALL(Date), [Day of Week] = 6 ), [Date Filter] )

Thank you for the Reply...In this formula...Last Friday = CALCULATE( MAX([Date]), FILTERALL(Date), [Day of Week] = 6 ), [Date Filter] )

 

the last part [Date Filter] is showing error... Do I have to derive any column? sorry i did not get..

Okay, that's weird. Could you send me the error message??

fareedice_0-1671102391374.png

 

Hello! I hope this will help you...

 

To create a dynamic measure that displays the last Friday of the current week, you can use the following steps:

  1. Create a calculated column in your date table that uses the "WEEKDAY" function to determine the day of the week for each date. For example, you can use the following formula to create a calculated column named "Day of Week":

     

    Day of Week = WEEKDAY([Date], 2)

     

    2. Create a measure that uses the "CALCULATE" function to filter the date table to only include the last Friday of the current week. For example, you can use the following formula to create a measure named "Last Friday":

     

    Last Friday = CALCULATE( MAX([Date]), FILTER( ALL(Date), [Day of Week] = 6 ) )

     

    This measure will return the last Friday in the current context. For example, if you filter the date table to only include dates from the current week, the measure will return the last Friday of that week. If you filter the date table to include dates from a different week, the measure will return the last Friday of that week instead.

    You can then use this measure in your Power BI report to display the last Friday of the current week whenever the report is opened by a user.

Hi Robert..
We are almost there

 

but we are getting as 12/27/2022 instead 12/16/2022

 

fareedice_0-1671101180228.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.