Forum Discussion
hosea_chumba
Helper I
4 years agoDAX FORMULA FOR MULTIPLE CONDITIONS
Consider the Table1 below; my expected output is a calculated column/measure with three fields indicating "Inadequate Colleteral, Adequate Colleteral and Not Applicable" i.e. based on the below conditions.
- Collateral amount must be at least 150% of the loan amount
- Condition (a) above does not apply for product ID "2222" and "4444"
My formula for calculated column did not work, kindly assist.
Table1:
| Loan Amount | Collateral Amount | Client ID | Product ID | Expected Output |
| 200 | 300 | X1 | 2222 | Not Applicable |
| 100 | 400 | X3 | 3333 | Adequate Colleteral |
| 600 | 200 | X4 | 4444 | Not Applicable |
| 300 | 450 | X6 | 5555 | Adequate Colleteral |
| 100 | 0 | X7 | 6666 | Inadequate Colleteral |
| 400 | 400 | X9 | 2222 | Inadequate Colleteral |
I have added the expected Output, the last column to the right
Hi hosea_chumba ,
Please try this:-
Column = SWITCH(TRUE(), 'Table'[Product ID ] in {2222,4444},"Not Applicable", DIVIDE('Table'[Collateral Amount],'Table'[Loan Amount],0)*100 >= 150,"Adequate colleteral", "Inadequate colleteral")Thanks,
Samarth
Hi hosea_chumba
Please refer to attached file.
4 Replies
- tamerj1
Community Champion
Hi hosea_chumba
Kindly add the expected results in an additional column to the same sample data with explanation.Thank you.
- hosea_chumba
Helper I
I have added the expected Output, the last column to the right
- tamerj1
Community Champion
- Samarth_18
Community Champion
Hi hosea_chumba ,
Please try this:-
Column = SWITCH(TRUE(), 'Table'[Product ID ] in {2222,4444},"Not Applicable", DIVIDE('Table'[Collateral Amount],'Table'[Loan Amount],0)*100 >= 150,"Adequate colleteral", "Inadequate colleteral")Thanks,
Samarth