Initial Quantity based on COUNT()

Hi.

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

IF(
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.

0 2 157
2 REPLIES 2

Steve
Platinum 4
Platinum 4

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

Top Labels in this Space