Forum Discussion
How calculate a column based on
Can I use the Related function to only return the rows in UMC Safety Incident Log where the column UMC Status = "Recordable" in the formula? There is a direct relationship between the udJob and UMC Safety Incident Log tables. If so, how would that look?
Hi ddeutschman,
Could you try the formula below to see if it works in your new scenario? :smileyhappy:
Date Last Recordable =
IF (
CALCULATE ( FIRSTNONBLANK ( 'UMC Safety Incident Log'[UMC Status], 1 ) )
= "Recordable",
IF (
ISBLANK ( CALCULATE ( MIN ( 'UMC Safety Incident Log'[Date of Incident] ) ) ),
udJob[StartDate],
CALCULATE ( MIN ( 'UMC Safety Incident Log'[Date of Incident] ) )
)
)
Regards
- ddeutschman8 years ago
Helper I
No. It did not return the the last Recordable Date for all Jobs. It did for only one - 6881. The FIRSTNONBLANK function is not finding the last entry in the data set.
I have an excel file with a subset of the jobs so you can see an example of the data that is in the UMC Safety Incident Log table. How can I upload the file?
- ddeutschman8 years ago
Helper I
Here is an example of the data:
UMC Status Date of Incident Project Number 10/26/14 6262 UMC First Aid 01/21/15 6262 Recordable 01/27/15 6262 UMC First Aid 06/18/15 6262 UMC First Aid 09/03/15 6262 10/08/15 6262 Recordable 01/14/15 6265 Recordable 07/19/16 6623 Notification 08/09/16 6623 Notification 10/03/16 6623 Notification 10/07/16 6623 12/01/16 6623 Notification 05/15/17 6623 Recordable 06/16/17 6623 UMC First Aid 06/29/17 6623 UMC First Aid 03/02/17 6881 Recordable 04/21/17 6881 UMC First Aid 05/10/17 6881 UMC First Aid 06/08/17 7000 - ddeutschman8 years ago
Helper I
Any further ideas? If you could help me with the syntax for a function for determining the set of UMC Safety Incident Log rows that are related to the udJob row that is being evaluated, I think I could take it from there. If there was a "Recordable" event, I am setting a Custom Column to 1. That is working. So I could perform a sum on the set of related rows and if > 0, then use the Max Incident Date for that related data set, otherwise set the value to the StartDate in udJob.
One twist to this is that there may be a NULL set of related rows if a Recordable event has not occurred.