cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
UnknownValue Occasional Visitor
Occasional Visitor

Date Shift from Today

Hi, 

 

I was wondering if someone can help me write a command that would take today's date subtract 1 business day from it and have it display as a new column with Yes or No value? 

 

I'm not sure if there is a way to differentiate between weekends and weekdays? For example, on Monday it would subtract 2 days to account for the weekend but on Tuesday through Friday it would subtract only 1 

I've already set up a calendar reference I just need to figure out how to write the command 

 

Thank you! 

1 ACCEPTED SOLUTION

Accepted Solutions
vimal_parmar Senior Member
Senior Member

Re: Date Shift from Today

@UnknownValue  in case you are looking for previous business date. Please create a calculated column

 

PrevBusinessDay = SWITCH(TRUE()
                                ,WEEKDAY('Calendar'[Date],2)=1,DATEADD('Calendar'[Date],-3,DAY)
                                ,NOT(WEEKDAY('Calendar'[Date],2)) IN {6,7}, DATEADD('Calendar'[Date],-1,DAY),BLANK())

PrevBusinessDay.png 

View solution in original post

1 REPLY 1
vimal_parmar Senior Member
Senior Member

Re: Date Shift from Today

@UnknownValue  in case you are looking for previous business date. Please create a calculated column

 

PrevBusinessDay = SWITCH(TRUE()
                                ,WEEKDAY('Calendar'[Date],2)=1,DATEADD('Calendar'[Date],-3,DAY)
                                ,NOT(WEEKDAY('Calendar'[Date],2)) IN {6,7}, DATEADD('Calendar'[Date],-1,DAY),BLANK())

PrevBusinessDay.png 

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)