Forum Discussion
PROBLEMS WITH IF AND DATEDIFF
- Anonymous5 years ago
Hi Anonymous ,
Try this
Dias_Vencimiento = IF('Consulta SLA'[dld_chk_codigo] = "",DATEDIFF('Consulta SLA'[FechaVencimiento_ML].[Date],TODAY(),DAY),BLANK())
or
Dias_Vencimiento = IF('Consulta SLA'[dld_chk_codigo] = "",DATEDIFF('Consulta SLA'[FechaVencimiento_ML].[Date],TODAY(),DAY),0)
DATEDIFF returns an interger. Here in your formula you are trying to return an integer as well as text hence the Expressions that produce Variant data types cannot be used to define calculated columns." error
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi Anonymous ,
Try this
Dias_Vencimiento = IF('Consulta SLA'[dld_chk_codigo] = "",DATEDIFF('Consulta SLA'[FechaVencimiento_ML].[Date],TODAY(),DAY),BLANK())
or
Dias_Vencimiento = IF('Consulta SLA'[dld_chk_codigo] = "",DATEDIFF('Consulta SLA'[FechaVencimiento_ML].[Date],TODAY(),DAY),0)
DATEDIFF returns an interger. Here in your formula you are trying to return an integer as well as text hence the Expressions that produce Variant data types cannot be used to define calculated columns." error
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thank you very much friend ! You're the best ! I was going crazy with this !!!!!