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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.