Forum Discussion
How calculate a column based on
Hi ddeutschman,
Could you try the formula below to see if it works in your scenario? :smileyhappy:
Date Last 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
Sorry, I have been out of the office and unable to test the function.
That worked but I realized that I need to base the calculation on another column, UMC Status in UMC Safety Incident Log. I tried the following but get the error that a single value for the column UMC Status can not be determined.
Date Last Recordable = IF ('UMC Safety Incident Log'[UMC Status] = "Recordable", IF(ISBLANK ( CALCULATE ( MIN ( 'UMC Safety Incident Log'[Date of Incident] ) ) ), udJob[StartDate], CALCULATE ( MIN ( 'UMC Safety Incident Log'[Date of Incident] ) ) ))
Thanks in advance for your assistance. I am a newbie and am still learning how to build formulas.
- ddeutschman8 years ago
Helper I
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?
- v-ljerr-msft8 years ago
Microsoft Employee
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