Avoid same dog in same day if sum of the events duration exceed another field

In My app I have these fields:

- dog

- day

- start datetime

- end datetime 

- duration (difference between them)

- personal standard duration

now, each dog has a personal standard duration, like 5 Hours/day.

When i create an event, i put start datetime and a end datetime (same day) to have the duration. Now, i would avoid that a user create other event for the same dog, if the sum of all the durations for the same dog in the same day exceed the personal standard duration

Solved Solved
0 1 37
1 ACCEPTED SOLUTION

With the validation, try something like..
(
SUM(
SELECT(Events[Duration],
AND([Dog]=[_THISROW].[Dog],[Date]=[_THISROW].[Date])
)
)
+
[Duration]
)
<=5

View solution in original post

1 REPLY 1

With the validation, try something like..
(
SUM(
SELECT(Events[Duration],
AND([Dog]=[_THISROW].[Dog],[Date]=[_THISROW].[Date])
)
)
+
[Duration]
)
<=5

Top Labels in this Space