Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

How to Compare two date fields?

I want to compare two date fields or set a value in the "Distancia" field when is showing the oldest date field ("Fecha").   I have this: 'Registro Diario' is a table. A column called "Fecha" and...
  • Vvelarde's avatar
    Vvelarde
    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

  • MFelix's avatar
    MFelix
    8 years ago

    Hi Anonymous,

     

    Looking at your PBIX file this as to be change to a measure as I refered in my first post and as Vvelarde also indicates in his response, if you do that it will give you 0 for the first record and 1 for all the others

     

     

    Regards,

    MFelix