Forum Discussion
Wrong difference in Hours From Two dates
Good afternoon everyone.
I'm going crazy trying to understand why Power bi shows me certain values in making the difference (in hours) between
two date fields.
I have a start date and an end date and I would like to calculate the difference in hours and then in working days (hours/8) using two calculated columns.
Where calculated columns are :
if(
IsBlank(cr35e_PRJ_BusFlow_tempifase[actualstart]) || ISBLANK(cr35e_PRJ_BusFlow_tempifase[actualend]) ||
cr35e_PRJ_BusFlow_tempifase[actualstart] > cr35e_PRJ_BusFlow_tempifase[actualend];
blank();
datediff(cr35e_PRJ_BusFlow_tempifase[actualstart];cr35e_PRJ_BusFlow_tempifase[actualend];HOUR)
)
Why?
Thanks in advance!
- Anonymous4 years ago
AndreaPRJ maybe dumb question, but given these are calculated columns and you're pulling them into a visual, what is the aggregation you have set on the "Difference in HH" column? (sum, average, do not summarize, etc.)
And, relatedly, are "actualstart" and "actualend" unique?
What I'm getting at here, is could those values you're seeing in "Difference in HH" actually be the sum of numerous records...
2 Replies
- AnonymousNot applicable
AndreaPRJ maybe dumb question, but given these are calculated columns and you're pulling them into a visual, what is the aggregation you have set on the "Difference in HH" column? (sum, average, do not summarize, etc.)
And, relatedly, are "actualstart" and "actualend" unique?
What I'm getting at here, is could those values you're seeing in "Difference in HH" actually be the sum of numerous records...- AndreaPRJHelper I
the question was not stupid ... it was a trivial mistake and I thank you!
It's Friday, I need a rest 🙂 bye!