Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi Everyone,
I am trying to get the second latest Friday date; I tried applying TOP N filter too but it didn't work. Please help me with this. I have a column with a list of Friday Dates.
Regards,
Rabi
Solved! Go to Solution.
Hi @Rabi
If you already have Date / Calendar table, adjust accordingly TOPN and FILTER part.
I created calculated column to check if 'Date'[Date] is expected value as you have.
My timezone is Europe (GMT+) - this is important as today is Friday and your time zone could be different so output could be different.
Did I answer correctly? Kudos appreciate / accept solution.
Proud to be a Super User!
@Rabi I just saw this post, although you already have a solution but for last year friday, it need tweaking because the logic will fail on leap year.
SameDayLastYear_Friday =
VAR __LastYear =
DATE(YEAR('Date'[SecondLastFriday])-1,MONTH('Date'[SecondLastFriday]),DAY('Date'[SecondLastFriday]))
VAR __WeekDayOffset = 6 - WEEKDAY ( __LastYear, 1 )
RETURN
__LastYear + __WeekDayOffset
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Rabi you can
2nd Last Friday From Today =
VAR __Today = TODAY ()
VAR __TodayWeekDay = WEEKDAY ( __Today, 1 )
VAR __OffSet = IF ( __TodayWeekDay >= 6, __TodayWeekDay - 6, __TodayWeekDay + 1 ) + 7
RETURN __Today - __OffSet
also use this expression to get the 2nd last Friday without iterating over date table:
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Rabi if you want most recent Friday from today then use this:
2nd Last Friday From Today =
VAR __Today = TODAY ()
VAR __TodayWeekDay = WEEKDAY ( __Today, 1 )
VAR __OffSet = IF ( __TodayWeekDay >= 6, __TodayWeekDay - 6, __TodayWeekDay + 1 )
RETURN __Today - __OffSet
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Rabi if you want most recent Friday from today then use this:
2nd Last Friday From Today =
VAR __Today = TODAY ()
VAR __TodayWeekDay = WEEKDAY ( __Today, 1 )
VAR __OffSet = IF ( __TodayWeekDay >= 6, __TodayWeekDay - 6, __TodayWeekDay + 1 )
RETURN __Today - __OffSet
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Rabi you can
2nd Last Friday From Today =
VAR __Today = TODAY ()
VAR __TodayWeekDay = WEEKDAY ( __Today, 1 )
VAR __OffSet = IF ( __TodayWeekDay >= 6, __TodayWeekDay - 6, __TodayWeekDay + 1 ) + 7
RETURN __Today - __OffSet
also use this expression to get the 2nd last Friday without iterating over date table:
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Rabi I just saw this post, although you already have a solution but for last year friday, it need tweaking because the logic will fail on leap year.
SameDayLastYear_Friday =
VAR __LastYear =
DATE(YEAR('Date'[SecondLastFriday])-1,MONTH('Date'[SecondLastFriday]),DAY('Date'[SecondLastFriday]))
VAR __WeekDayOffset = 6 - WEEKDAY ( __LastYear, 1 )
RETURN
__LastYear + __WeekDayOffset
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Rabi "second latest Friday date" on 15.09.2023 is what date? I am aksing as today is 15.09.2023 and depending when you answer "second latest Friday date" will be another date.
Proud to be a Super User!
Hi @some_bih
Current friday is 15/09/2023 but I want to filter my data with last week's friday date which is 08/09/2023
Thanks !!
Hi @Rabi
If you already have Date / Calendar table, adjust accordingly TOPN and FILTER part.
I created calculated column to check if 'Date'[Date] is expected value as you have.
My timezone is Europe (GMT+) - this is important as today is Friday and your time zone could be different so output could be different.
Did I answer correctly? Kudos appreciate / accept solution.
Proud to be a Super User!
Hi @some_bih
can you also help me with getting a year date from last week's Friday date for instance, last week Friday date was 08/09/2023 its a year equivalent would be 08/09/2022
thanks for help !!
Hi @Rabi
For Friday / Monday option, just adjust part
Proud to be a Super User!
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
14 | |
11 | |
7 |