Forum Discussion
DATEDIFF(TODAY();Table[Date]) not working...
- 7 years ago
Asantos2020 I have tried with the sample data present in snapshot and i am getting the correct difference days.I have the DataPedido column which has dates in "MM/DD/YYYY" format which i changed in the "DD-MMM-YY" and then created a calculated column to find out the days using the DATEDIFF() function and even if i don't change the format of DataPedido and still be in DD/MM/YYYY i am getting the correct difference days.
I know this won't help much for you to solve the issue.. but you can try to change the date format of DataPedido column to DD/MM/YYYY and check if you are getting the correct result.
Please do let us know if you are able to solve the issue.
Thank you,
Chayan Upadhyay
- 7 years ago
Hi chayanupadhyay ,
My problem persisted, even after I've changed the date format to match each other's. But I have just found out what was causing it:
The field was aggregating, considering the fact that there is more than one row containing that PO number and dates. So it was summing the days!
Thank you for your help!
Regards,
Antonio
Hello chayanupadhyay , dax , parry2k !
Thanks for the taking the time to help.
Below, you can see that the DAX expression is giving me by row:
The first row is correct, but the second, being 75, makes no sense. I've tried formatting like FORMAT(UTCTODAY();"dd/MM/yyyy");DAY), but it gives the same result as the one above.
I have also changed Locale setting on Power Query for those columns to Date and Portuguese (Brasil).
Appreciate your attention!
Antonio
Asantos2020 I have tried with the sample data present in snapshot and i am getting the correct difference days.I have the DataPedido column which has dates in "MM/DD/YYYY" format which i changed in the "DD-MMM-YY" and then created a calculated column to find out the days using the DATEDIFF() function and even if i don't change the format of DataPedido and still be in DD/MM/YYYY i am getting the correct difference days.
I know this won't help much for you to solve the issue.. but you can try to change the date format of DataPedido column to DD/MM/YYYY and check if you are getting the correct result.
Please do let us know if you are able to solve the issue.
Thank you,
Chayan Upadhyay
- Asantos20207 years ago
Advocate II
Hi chayanupadhyay ,
My problem persisted, even after I've changed the date format to match each other's. But I have just found out what was causing it:
The field was aggregating, considering the fact that there is more than one row containing that PO number and dates. So it was summing the days!
Thank you for your help!
Regards,
Antonio
- chayanupadhyay7 years ago
Helper III
That's great.
Happy to help :smileyhappy:
Regards,
Chayan Upadhyay