Forum Discussion

Felipekard's avatar
Felipekard
Frequent Visitor
3 years ago
Solved

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.

 

 

DAYSIS WORKDAY?LAST WORKDAY
01/01/2023 1 -
02/01/2023101/01/2023
03/01/2023102/01/2023
04/01/2023003/01/2023
05/01/2023103/01/2023
06/01/2023105/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

  • 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
        )