How to calculate max timestamp between 2 tags

Hello. I need some help. In Pi Vision I'm trying to set up a calculation, but can't seem to figure it out. I have 2 sensors that read either 0 or 1. 0 being an idle state, and 1 being productive. I'm trying calculate a total idle duration. I can do this for each individual sensor easily enough, but when trying to calculate the duration together I'm having a hard time. I'm trying to use the MAX and PREVEVENT functions to get this, but it's not working.

 

Here is what I thought would work:

IF ('tag1' + 'tag2') = 0

THEN ('*' - MAX(PREVEVENT('tag1', '*'), PREVEVENT('tag2', '*'))) / 60

ELSE 0

My assumption was that if both sensors are reading 0, then it would take the current time and subtract the latest previous timestamp between the 2 tags, and then dividing that value by 60 would give me the minutes that both sensors have been idle. Can anyone help me figure out what I'm doing wrong. I'm getting an error: [-12315]Performance Equation: Function has bad argument data type.

For reference, I use this calculation to calculate the idle time of each sensor individually, which works just fine:

IF 'tag1' = 0

THEN ('*' - PREVEVENT('tag1', '*')) / 60

ELSE 0