Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 conditions. These conditions are as follows: Retraining is required for a driver with two non-preventable collisions within 18 months or if a collision is preventable. For everything else, the return value should be "No." I created a dax that worked for the first part (2 non-preventable over 18-mos) of the condition; however, I'm struggling with the 2nd part of the syntax. Please see below for reference:
Any assistance would be greatly appreciated. Thanks, in advance.
Solved! Go to Solution.
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.
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.
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
Hi @taskinosurname ,
Maybe something like this using OR. Pleas double check the ().
Thank you for the quick response. I appreciate it.
I tried your possible solution with no success. Oddly enough, it's even counting Non-preventables' outside 18 months.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |