Forum Discussion
Anonymous
4 years agoNot applicable
True/False column based off other rows in a table
hello
I would like to create a column that gives a TRUE/FALSE result when looking at matching criteria in other rows in a table.
I would like to check if a USER_ID, LOCATION_ID & DATE match. The Result would look like the below table. Rows 1 & 2 have the same criteria, so the answer is TRUE
Thanks
| USER_ID | LOCATION_ID | DATE | TRUE/FALSE |
| 1 | 5 | 01/01/2022 | TRUE |
| 1 | 5 | 01/01/2022 | TRUE |
| 3 | 3 | 01/01/2022 | FALSE |
| 4 | 3 | 01/01/2022 | FALSE |
Hi Anonymous ,
Please create a column as below:-
TRUE/FALSE = VAR result = COUNTROWS ( FILTER ( 'Table (4)', 'Table (4)'[USER_ID] = EARLIER ( 'Table (4)'[USER_ID] ) && 'Table (4)'[LOCATION_ID] = EARLIER ( 'Table (4)'[LOCATION_ID] ) && 'Table (4)'[DATE] = EARLIER ( 'Table (4)'[DATE] ) ) ) RETURN IF ( result > 1, TRUE (), FALSE () )Output;-
Thanks,
Samarth
2 Replies
- Samarth_18Community Champion
Hi Anonymous ,
Please create a column as below:-
TRUE/FALSE = VAR result = COUNTROWS ( FILTER ( 'Table (4)', 'Table (4)'[USER_ID] = EARLIER ( 'Table (4)'[USER_ID] ) && 'Table (4)'[LOCATION_ID] = EARLIER ( 'Table (4)'[LOCATION_ID] ) && 'Table (4)'[DATE] = EARLIER ( 'Table (4)'[DATE] ) ) ) RETURN IF ( result > 1, TRUE (), FALSE () )Output;-
Thanks,
Samarth
- AnonymousNot applicable
Thank you Samarth_18 it works a dream