Forum Discussion
NewbieJono
2 years agoPost Partisan
Previous working date
hello, i have a date table with a marker (1,0) and I mark a working day as a 1. What do I need to do to get the previous working date.
For example
On a bank holiday weekend, on Tuesday I would like to find out Friday's date
i have markers of 1's for all working days
NewbieJonoUse the below dax code to find out previous working date :
LastWorkingDate =VAR _previousDate = CALCULATE(MAX('date'[Date]),FILTER(ALL('date'),'date'[Date] < SELECTEDVALUE('date'[Date]) && NOT 'date'[Is Workday?] IN {0}))RETURNIF(SELECTEDVALUE('date'[Is Workday?]) = 0,_previousDate) //only showing last working date for holiday, other will be blank
Hope this help!!
If this answered your question, please mark it as a solution!!
4 Replies
- shafiz_pSuper User
NewbieJonoUse the below dax code to find out previous working date :
LastWorkingDate =VAR _previousDate = CALCULATE(MAX('date'[Date]),FILTER(ALL('date'),'date'[Date] < SELECTEDVALUE('date'[Date]) && NOT 'date'[Is Workday?] IN {0}))RETURNIF(SELECTEDVALUE('date'[Is Workday?]) = 0,_previousDate) //only showing last working date for holiday, other will be blank
Hope this help!!
If this answered your question, please mark it as a solution!! - shafiz_pSuper User
NewbieJonoUse the given code to find out last working date :
LastWorkingDate =VAR _previousDate = CALCULATE(MAX('date'[Date]),FILTER(ALL('date'),'date'[Date] < SELECTEDVALUE('date'[Date]) && NOT 'date'[Is Workday?] IN {0}))RETURN//only showing last working date for holiday, other will be blankIF(SELECTEDVALUE('date'[Is Workday?]) = 0,_previousDate)Hope this help🙂
If this answered your question, please mark it as a solution!!