Forum Discussion
DATEDIFF incorrectly calculating
- 8 years ago
Hi Anonymous,
Please check if you have more than one row that contains the same PO and Shipped dates. Your Days to Ship might have been aggregated.
PO Date Shipped Date Days to Ship-incorrect Days to Ship-correct Number of Rows? 2/7/2018 2/28/2018 105 21 5 1/17/2018 2/23/2018 74 37 2
Hi Anonymous,
Please check if you have more than one row that contains the same PO and Shipped dates. Your Days to Ship might have been aggregated.
| PO Date | Shipped Date | Days to Ship-incorrect | Days to Ship-correct | Number of Rows? |
| 2/7/2018 | 2/28/2018 | 105 | 21 | 5 |
| 1/17/2018 | 2/23/2018 | 74 | 37 | 2 |
- Anonymous8 years agoNot applicable
I am sorry for the delayed response. I will check that and get back to you on if that solves the issue.
- v-yulgu-msft8 years agoMicrosoft Employee
Hi Anonymous,
Have you resolved it? If yes, would you please accept the helpful suggestion as an answer or sharing your resolution so that it can benefit more users?
Regards,
Yuliana Gu
- Anonymous8 years agoNot applicable
I apologize for the late response. I got pulled onto another project and haven't have the chance to check if there were duplicates that were aggregating until today. Once people see you can do cool things in Power BI, they want you to create a slew of reports and dashboards.
So anyways, what I found was that when I was merging two queries on what I thought was a unique identifier. One of those queries had multiple lines for that "uniuqe identifier" and was indeed aggregrating the number rows and providing the multiplied number of days between the dates. Thank you for everyone's help on this and especially danextian in helping determine the root cause. Again, I apologize for the tardiness in my response. The fix was to just make sure I had a true unique identifier when I merged the two queries and now everything is calculating as it should.