Initial Quantity based on COUNT()


I am trying to set the initial value of my [Production Start Time] column in Works_Orders_Master table to 07:30:00 if the number of times that column [Production Start Date] with a value of TODAY() is equal to 0. Otherwise I want the initial value to be the MAX value of [Production Finish Time]. I have something like the following

COUNT(Works_Orders_Master[Date of Production]=TODAY())=0,07:30:00,
MAX(SELECT(Works_Orders_Master[Production Finish Time],[Date of Production]=TODAY()))

I am getting an error ‘Cannot compare List with Date’ but I am not sure I have the expression correct even beyond that error.

Could someone help refine this to get it to achieve the desired behaviour?

Many thanks.

You’re comparing this values in the Date of Production column of the Works_Orders_Master table (a list) to the current date (a singular value):

Works_Orders_Master[Date of Production]=TODAY()

Instead, try:

FILTER("Works_Orders_Master", [Date of Production]=TODAY())

Thank you @Steve.

Working now :grinning:

1 Like