Forum Discussion
Anonymous
7 years agoNot applicable
Reference Previous Row for Calculated Column
Hi everyone, I have the following thable where I have 3 columns: What I need to doo, is to add a new column where it indicates in a binary code ( 0 , 1) wether the new register is i...
- 7 years ago
Hello Anonymous
Give this a try. It filters the table based on the info from the current row then counts the number of rows returned. If the count is >= 1 it is a continuing absence.
Check = VAR CurrWorker = 'Table'[Worker Code] VAR CurrDate = 'Table'[Date] VAR AbsType = 'Table'[Type Absence] RETURN IF ( ISBLANK ( COUNTROWS( FILTER('Table', 'Table'[Worker Code] = CurrWorker && 'Table'[Type Absence] = AbsType && 'Table'[Date] < CurrDate && 'Table'[Date] >= CurrDate -5 ) ) ),1,0)
jdbuchanan71
7 years agoSuper User
Hello Anonymous
Give this a try. It filters the table based on the info from the current row then counts the number of rows returned. If the count is >= 1 it is a continuing absence.
Check =
VAR CurrWorker = 'Table'[Worker Code]
VAR CurrDate = 'Table'[Date]
VAR AbsType = 'Table'[Type Absence]
RETURN
IF (
ISBLANK (
COUNTROWS(
FILTER('Table',
'Table'[Worker Code] = CurrWorker &&
'Table'[Type Absence] = AbsType &&
'Table'[Date] < CurrDate &&
'Table'[Date] >= CurrDate -5
)
)
),1,0)Anonymous
7 years agoNot applicable