Forum Discussion
DAX Calculated measure verification
- 2 years ago
I cannot merge tables since this is direct query.
Level 1a = IF( ('App'[Total] <= 24) && ('App'[App Purpose] = "Purchase" || 'App'[App Purpose] ="Refinance"), IF(CALCULATE(COUNTROWS('App Role'), 'App Role'[Applicant Type]= "Individual" && 'App Role'[Role] = "PB") > 0 ,1,0),0)The below formula did the trick for me.
Hi, I have attached a sample PBIX file, Refer to App ID 914, The result of Level 1 should be 0 but I get 1.
https://github.com/khushs9966/SampleAnalysis/blob/main/test.pbix
Hi Khushboo9966 ,
According to your statement, I think you can try code as below to update [Level1] calculated column.
Level 1 NEW =
VAR _PBLIST =
CALCULATETABLE (
VALUES ( 'App Role'[Role] ),
FILTER (
'App Role',
'App Role'[App ID] = EARLIER ( App[App ID] )
&& 'App Role'[Applicant Type] = "Individual"
)
)
RETURN
IF (
( 'App'[Total] <= 24 )
&& ( 'App'[App Purpose] = "Purchase"
|| 'App'[App Purpose] = "Refinance" ),
IF ( MAXX ( FILTER ( 'App Role', "PB" IN _PBLIST ), 1 ) > 0, 1, 0 ),
0
)
Result for you sample is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Khushboo99662 years ago
Helper II
Anonymous Formula runs an error in a circular redundancy. I have update my pbix file with table relationships. Can you please look into it?
SampleAnalysis/test.pbix at main · khushs9966/SampleAnalysis (github.com)