Forum Discussion
How to Compare two date fields?
- 8 years ago
Anonymous
Hi, instead of using a calculated column you need to use a measure
D2 = IF ( MIN ( 'Registro Diario'[Fecha] ) = [Prueba]; 0; 1 )
Regards
Victor
I apologize because I said something wrong, in fact the distance field that I have as a column is because I need to perform the following calculation
Distancia (KM)= var Lat1='Registro Diario'[Latitud - Distancia] * 3,1415 / 180
var Lat2 = 'Registro Diario'[Latitud - Distancia.Anterior] * 3,1415 / 180
var Lon1 = 'Registro Diario'[Longitud - Distancia] * 3,1415 / 180
var Lon2 = 'Registro Diario'[Longitud - Distancia.Anterior] * 3,1415 / 180
var valor = Cos( Lat1 ) * Cos( Lat2 ) * Cos( Lon2 - Lon1 ) + Sin( Lat1 ) * Sin( Lat2 )
return IF(valor<0,99999999999999999999;IF('Registro Diario'[Fecha]=CALCULATE ( MIN ( 'Registro Diario'[Fecha] ); ALLSELECTED ( 'Registro Diario' ) );0;6378*ACOS(valor));0)
When I try to pass it as a measure this columns weren't recognized
'Registro Diario'[Longitud - Distancia.Anterior]
'Registro Diario'[Longitud - Distancia]
'Registro Diario'[Latitud - Distancia.Anterior]
'Registro Diario'[Latitud - Distancia]
I apologize for the lack of information
Hi Anonymous,
Try to use a MAX or MIN function on those columns to make context on them.
Regards,
MFelix