Forum Discussion
taskinosurname
3 years agoFrequent Visitor
Return "Yes" or "No" based on Multiple Conditions
Hi Everyone, I'm working on a collision dashboard/report where it would identify whether a driver requires retraining or not. The measure would return a value of "Yes" or "No" based on certain co...
- 3 years ago
Hi, taskinosurname
You can try the following methods.
Sample data:Measure:
Difference = IF(SELECTEDVALUE('Table'[Last Collision Date])=BLANK(),0, ABS (DATEDIFF (SELECTEDVALUE ( 'Table'[Date] ), SELECTEDVALUE ( 'Table'[Last Collision Date] ),MONTH)))Retraining Req'd = IF (SELECTEDVALUE ( 'Table'[Last Collision Date] ) <> BLANK () && SELECTEDVALUE ( 'Table'[Type] ) = "Non Preventable" && [Difference] < 18, "Yes", IF (SELECTEDVALUE ( 'Table'[Last Collision Date] ) = BLANK () && SELECTEDVALUE ( 'Table'[Type] ) = "Preventable", "Yes", "No" ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
Community Support
3 years agoHi, taskinosurname
You can try the following methods.
Sample data:
Measure:
Difference = IF(SELECTEDVALUE('Table'[Last Collision Date])=BLANK(),0,
ABS (DATEDIFF (SELECTEDVALUE ( 'Table'[Date] ),
SELECTEDVALUE ( 'Table'[Last Collision Date] ),MONTH)))Retraining Req'd =
IF (SELECTEDVALUE ( 'Table'[Last Collision Date] ) <> BLANK ()
&& SELECTEDVALUE ( 'Table'[Type] ) = "Non Preventable"
&& [Difference] < 18,
"Yes",
IF (SELECTEDVALUE ( 'Table'[Last Collision Date] ) = BLANK ()
&& SELECTEDVALUE ( 'Table'[Type] ) = "Preventable",
"Yes",
"No"
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- taskinosurname3 years agoFrequent Visitor
Thanks a million. This is what I was looking for. Given that I'm still relatively a novice with DAX, I would've never thought to put a measure within a measure. Thanks again.
Warm regards,
Taski