Forum Discussion
Dynamic weekend date
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:
- 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.
- fareedice3 years agoFrequent Visitor
Hi Robert..
We are almost therebut we are getting as 12/27/2022 instead 12/16/2022