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 woul...
- 2 years ago
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_p
2 years agoSuper 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 blank
IF(SELECTEDVALUE('date'[Is Workday?]) = 0,_previousDate)
Hope this helpπ
If this answered your question, please mark it as a solution!!
Anonymous
2 years agoNot applicable
Hi,shafiz_p
Thank you for sharing, it is very helpful to our community, hope your life goes well.
Best Regards,
Leroy Lu