cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gmasta1129
Helper III
Helper III

Previous Day - Excluding Weekend

Hello,

 

I have a report that runs 5 days a week (excludes weekends).  There is a "Run Date" column which contains the date the report was run.  I would like to retreive the previous day from the run date but I am having an issue because of weekend dates.  

 

For example, August 29th is a Monday.  Run Date = 8/29/2022.  The Previous Day should be Friday August 26th 2022 8/26/2022 

and not Sunday August 28th  8/28/2022

 

What type of formula can i use for this? 

1 ACCEPTED SOLUTION
ahmadibrahimbus
Resolver III
Resolver III

Dear @gmasta1129 ,

please use the below dax:

Previous_date = if( FORMAT(Sheet1[Run Date], "dddd")="Monday",Sheet1[Run Date]-3,Sheet1[Run Date]-1)
let me know if it's help.

View solution in original post

2 REPLIES 2
gmasta1129
Helper III
Helper III

Worked perfectly. Thank you for your help! 

ahmadibrahimbus
Resolver III
Resolver III

Dear @gmasta1129 ,

please use the below dax:

Previous_date = if( FORMAT(Sheet1[Run Date], "dddd")="Monday",Sheet1[Run Date]-3,Sheet1[Run Date]-1)
let me know if it's help.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors