Forum Discussion

hosea_chumba's avatar
hosea_chumba
Icon for Helper I rankHelper I
4 years ago
Solved

DAX 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.

  1. Collateral amount must be at least 150% of the loan amount
  2. Condition (a) above does not apply for product ID "2222" and "4444"

My formula for calculated column did not work, kindly assist.

Table1:
Loan AmountCollateral AmountClient IDProduct ID Expected Output
200300X12222Not Applicable
100400X33333Adequate Colleteral
600200X44444Not Applicable
300450X65555Adequate Colleteral
1000X76666Inadequate Colleteral
400400X92222Inadequate Colleteral

4 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi hosea_chumba 
    Kindly add the expected results in an additional column to the same sample data with explanation.

    Thank you.

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity 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