Forum Discussion
Felipekard
3 years agoFrequent Visitor
Last day dax
Morning everyone,
I has one calendar table, like this:
Days: the days
IS WORKDAY: 1 if is workday, 0 if isn't work day
LAST WORKDAY: the workday -1
I need made this calculated column LAST WORKDAY, below i will put the expect result.
| DAYS | IS WORKDAY? | LAST WORKDAY |
| 01/01/2023 | 1 | - |
| 02/01/2023 | 1 | 01/01/2023 |
| 03/01/2023 | 1 | 02/01/2023 |
| 04/01/2023 | 0 | 03/01/2023 |
| 05/01/2023 | 1 | 03/01/2023 |
| 06/01/2023 | 1 | 05/01/2023 |
You could create a column like
Last workday = VAR CurrentDate = 'Date'[Date] RETURN CALCULATE ( MAX ( 'Date'[Date] ), REMOVEFILTERS ( 'Date' ), 'Date'[Date] < CurrentDate, 'Date'[Is working day] = 1 )
2 Replies
- johnt75
Super User
You could create a column like
Last workday = VAR CurrentDate = 'Date'[Date] RETURN CALCULATE ( MAX ( 'Date'[Date] ), REMOVEFILTERS ( 'Date' ), 'Date'[Date] < CurrentDate, 'Date'[Is working day] = 1 )- FelipekardFrequent Visitor
Works great! Thank you my friend.