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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
learner03
Post Partisan
Post Partisan

Minus 2 days except Weekend

I Have to make a Flagged column based on following condition-

If Arrived date minus 2 days except weekend/holiday has Arrived as NO, then 0
If Arrived date minus 2 days except weekend/holiday has Arrived as Yes, then 1

 

For identifying weekend/holiday, I have calender table where there is a column that says 1 for workday and 0 for weekend/holiday.

 

 

Product  
ArrivedArrived DateFlagged (1/0)
Yes24/02/2022 
no12/02/2022 
no13/02/2022 
no22/02/2022 
Yes21/02/2022 
1 ACCEPTED SOLUTION

@learner03 , try like

 

new column =
var _rank = maxx(filter('date', 'date'[Date] = table[Arrival date] +2), date[Work Date cont Rank])
return
maxx(filter('date', 'date'[Work Date cont Rank] = _rank), date[date])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@learner03 , refer to my blog

Traveling Across Workdays - What is next/previous Working day
https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak i saw your pbix and the +10 days is a measure. How can I have this as a calculated column?

@learner03 , try like

 

new column =
var _rank = maxx(filter('date', 'date'[Date] = table[Arrival date] +2), date[Work Date cont Rank])
return
maxx(filter('date', 'date'[Work Date cont Rank] = _rank), date[date])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak I understood the blog, but unable to apply in relation to my query related to minus 2 with arrived date

@learner03 , Try a new column in you table, using date table

 

new column =
var _rank = maxx(filter('date', 'date'[Date] = table[Arrival date] +2), date[Work Date cont Rank])
return
maxx(filter('date', 'date'[Work Date cont Rank] = _rank), date[date])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.