Forum Discussion
Anonymous
3 years agoNot applicable
check if value exists in multiple columns
Hi Guys,
Need your help on powerbi desktop please.
I am trying to workout a calculation to check mutiple column status for each row; if any of the column has 1 or more "Expired" status, in the result colum should reflect as "Expired" if not should reflect as "Valid". Please assist.
| ID | Status1 | Status2 | Status3 | Status4 | Status5 | Result |
| Employee1 | Expired | Expired | 1 Month | Expired | 2 Months | |
| Employee2 | Expired | 1 Month | Expired | 1 Month | 1 Month | |
| Employee3 | 1 Month | 1 Month | 1 Month | 1 Month | Expired | |
| Employee4 | 3 Months | 3 Months | 3 Months | 3 Months | 3 Months | |
| Employee5 | 1 Month | Expired | 1 Month | Expired | 1 Month | |
| Employee6 | Expired | 1 Month | Expired | 1 Month | 1 Month | |
| Employee7 | 3 Months | 1 Month | 1 Month | 1 Month | 1 Month | |
| Employee8 | 1 Month | 1 Month | 1 Month | 1 Month | 1 Month | |
| Employee9 | Expired | 1 Month | 1 Month | 1 Month | 1 Month | |
| Employee10 | 3 Months | 3 Months | 3 Months | 3 Months | 3 Months |
Hi Anonymous ,
You can use the below DAX
Result = IF('Table'[Status1] = "Expired" || 'Table'[Status2] = "Expired" || 'Table'[Status3] = "Expired" || 'Table'[Status4] = "Expired" || 'Table'[Status5] = "Expired", "Expired", "Valid")Output will be as shown below
1 Reply
- Thejeswar
Super User
Hi Anonymous ,
You can use the below DAX
Result = IF('Table'[Status1] = "Expired" || 'Table'[Status2] = "Expired" || 'Table'[Status3] = "Expired" || 'Table'[Status4] = "Expired" || 'Table'[Status5] = "Expired", "Expired", "Valid")Output will be as shown below