The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
Solved! Go to Solution.
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
)
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
)
Works great! Thank you my friend.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |