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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to select 2nd Sunday from a filter (not the newest Sunday, but the one that was before)

Hello, 

 

I have such a situation. I need to set up a filter where it can automatically grab not the newest date but the second newest Sunday.

 

  Like for this visualization I want to have forecast of the week starting 1/02, not 1/09 so i need to set up the filter so that it selects 2nd Sunday. 

 

 

DIFF1_0-1642016362409.png

 

I understand it should be done from here, but if I just select manually '1/2/2022' I will need to go back and forth every week and select the new date. 

 

DIFF1_1-1642016440193.png

 

Does someone know how I can do this?

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Based on your description, you need to create a disconnected calendar table as a slicer, and then create a measure and apply it to the visual level filter.

Measure = 
var _start = MIN('Table 2'[date])-WEEKDAY(MIN('Table 2'[date]),1)-6
return IF(MAX('Table'[date])>=_start,1)

Vlianlmsft_0-1642488415491.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

@amitchandak 

I am not sure I understand what I need to do. I basically need to have a column which will look at STARTDATE column and transfer that day to previous week Sunday in a new column. I am not sure maybe it should be Calculated column or a measure... 

 

I read this link, but I am not sure what I need to replicate since it doesn't look like what I need. 

Week Is Not So Weak: WTD, Last WTD, and This Week ... - Microsoft Power BI Community

 

My apology, maybe you are right, but I really don't understand what I need to do. If you could write what I need to do, I will greatly appreciate.

Anonymous
Not applicable

I don't have a date table. Can I paste this code to my regular table?

Anonymous
Not applicable

 
Amitchandak thank you. I am not sure I understand what I need to do. 
 
 
 
 I need 
second Saturday from today
 
 
 
 
.
 
 
 
Screenshot 2022-01-13 210036.JPG
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Hi @Anonymous ,

 

Based on your description, you need to create a disconnected calendar table as a slicer, and then create a measure and apply it to the visual level filter.

Measure = 
var _start = MIN('Table 2'[date])-WEEKDAY(MIN('Table 2'[date]),1)-6
return IF(MAX('Table'[date])>=_start,1)

Vlianlmsft_0-1642488415491.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous ,what you are asking here is WOW comparision

if yes, then check if this can help

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Amitchandak your formula gives me 1/21/2022. 

I need 1/2/2022. And it should stay like this Sunday - Saturday, and from next Sunday jump to 1/9/2022.

 

 

DIFF1_2-1642136729262.png

 

amitchandak
Super User
Super User

@Anonymous , Second Sunday based on year start or to date

new columns in date table

based on today

Second Sunday= today() + 14 -1*WEEKDAY(today(),2)

 

based on year start

 

Second Sunday=

var _today  = date(year(today()) ,1,1)

return

_today  + 14 -1*WEEKDAY(_today  ,2)

 

 

You need a column in date table

if([Date]= [Second Sunday], "Second Sunday" , [Date] )

 

Select and save this in slicer or filter

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors