Forum Discussion
char23
2 years agoHelper II
Compare data in same table based on column value
Hello, I am trying to mark any item that is not found earlier in the table as "Deleted " , but I want to ignore any data with value 3 or greater in my [entry] column. I am trying to add the [Deleted ...
- 2 years ago
char23 Yes, I would modify it as follows:
Deleted Previous Tasks = VAR _id = 'Table'[Id] VAR _entry = 'Table'[Entry] VAR _minEntry = MINX( ALL( 'Table' ), [Entry] ) VAR _table = SELECTCOLUMNS(FILTER('Table', 'Table'[Entry] = _entry - 1), "_id", 'Table'[Id]) VAR _result = SWITCH( TRUE(), _entry > 2 || _entry = _minEntry, BLANK(), _id IN _table, BLANK(), "Deleted" ) RETURN _result
char23
2 years agoHelper II
Thank you! This almost does what I want it to do. But now, it just lists "Deleted" for all rows with entry 1. I want to label those with entry 2 as deleted if not found in one. Could it be something with the _result variable? Should I change one of the conditions? Below is what I have now.
Deleted Previous Tasks =
VAR _id = 'Table'[Id]
VAR _entry = 'Table'[Entry]
VAR _table = SELECTCOLUMNS(FILTER('Table', 'Table'[Entry] = _entry - 1), "_id", 'Table'[Id])
VAR _result =
SWITCH( TRUE(),
_entry > 2, BLANK(),
_id IN _table, BLANK(),
"Deleted"
)
RETURN
_result
Greg_Deckler
2 years agoCommunity Champion
char23 Yes, I would modify it as follows:
Deleted Previous Tasks =
VAR _id = 'Table'[Id]
VAR _entry = 'Table'[Entry]
VAR _minEntry = MINX( ALL( 'Table' ), [Entry] )
VAR _table = SELECTCOLUMNS(FILTER('Table', 'Table'[Entry] = _entry - 1), "_id", 'Table'[Id])
VAR _result =
SWITCH( TRUE(),
_entry > 2 || _entry = _minEntry, BLANK(),
_id IN _table, BLANK(),
"Deleted"
)
RETURN
_result