Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hosea_chumba
Helper I
Helper I

DAX EQUATION

Consider the Table1 below; my objective is to calculate a column/measure that identifies whether a loan amount meets or that does not meet the following condition or does not apply:

  • Collateral amount must be at least 150% of the loan amount and does not apply for product ID "2222" and "4444"

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

Inadequately secured loans =
VAR _inadequate_security = CALCULATE(FILTER('Table1','Table1'[Collateral Amount] < 1.5*'Table1'[Loan Amount]
 && NOT('Table1'[Product ID]) IN {2222,4444})))
VAR _result_ = SWITCH(TRUE(),
_inadequate_security,"Inadeqaute Security",
"Adequate Security")
RETURN
_result_
 
Table1:
Loan AmountCollateral AmountClient IDProduct ID 
200300X12222
100400X33333
600200X44444
300450X65555
1000X76666
400400X92222
1 ACCEPTED SOLUTION
PurpleGate
Resolver III
Resolver III

 

Hi, 

 

How about something like this

 

Security Measure = 
VAR __Collateral = DIVIDE(SELECTEDVALUE('Table'[Collateral Amount]),SELECTEDVALUE('Table'[Loan Amount]))
VAR __ProductID = SELECTEDVALUE('Table'[Product ID ])
VAR __result = IF(__Collateral >=1.5 && __ProductID <> 2222 && __Collateral >=1.5 && __ProductID <> 4444,"Inadequate Security","Adequate Security")
RETURN __result

PurpleGate_0-1660894872842.png

 

View solution in original post

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

You need a calculated column for this, not a measure.

[Inadequately Secured] = // calc column, not a measure
IF(
  NOT( T[Product ID] IN {2222, 4444} ),
  IF( 
    T[Collateral Amount] >= 1.5 * T[Loan Amount],
    "Adequate Security",
    "Inadequate Security"
  ),
  "Adequate Security"
)

If you use a measure... you won't be able to slice and dice by such values.

PurpleGate
Resolver III
Resolver III

 

Hi, 

 

How about something like this

 

Security Measure = 
VAR __Collateral = DIVIDE(SELECTEDVALUE('Table'[Collateral Amount]),SELECTEDVALUE('Table'[Loan Amount]))
VAR __ProductID = SELECTEDVALUE('Table'[Product ID ])
VAR __result = IF(__Collateral >=1.5 && __ProductID <> 2222 && __Collateral >=1.5 && __ProductID <> 4444,"Inadequate Security","Adequate Security")
RETURN __result

PurpleGate_0-1660894872842.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.