Forum Discussion
How to reference date column in measure
- Anonymous5 years ago
Hi ben-t ,
This error is because in the measure, you cannot write the field directly. You need to use MAX or MIN to get the current row of the field.
Try to add MAX/MIN in the error field of the red curve.
Hrs measure = DATEDIFF ( IF ( ISBLANK ( MAX ( 'MachAvail'[ACTSTART] ) ), [Min Date], MAX ( ' MachAvail'[ACTSTART] ) ), IF ( ISBLANK ( MAX ( 'MachAvail'[ACTFINISH] ) ), [Max Date], MAX ( 'MachAvail'[ACTFINISH] ) ), SECOND )Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ben-t ,
This error is because in the measure, you cannot write the field directly. You need to use MAX or MIN to get the current row of the field.
Try to add MAX/MIN in the error field of the red curve.
Hrs measure =
DATEDIFF (
IF (
ISBLANK ( MAX ( 'MachAvail'[ACTSTART] ) ),
[Min Date],
MAX ( ' MachAvail'[ACTSTART] )
),
IF (
ISBLANK ( MAX ( 'MachAvail'[ACTFINISH] ) ),
[Max Date],
MAX ( 'MachAvail'[ACTFINISH] )
),
SECOND
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
I am facing the similar kind of error in which i am creating a Measure and comapring date column (Deliver Date) with today date and getting the he same error as mentioned below :
Request you to please help how can i compare my date value column with Today date in Measure where i do not want to take Min or Max .
Please see below :
Thanks ,
Ashish