Forum Discussion
DATEDIFF between DateTime Values by ID
- 5 years ago
Anonymous , Try a measure like
averageX(values(Table[ID]), calculate(datediff(minx(filter(Table, Table[Entry] =1), [DateTime]),maxx(filter(Table, Table[exit] =1), [DateTime]),minute)))
Hi, Anonymous
Please check the below picture and the sample pbix file's link down below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
- Anonymous5 years agoNot applicable
Thanks!
downloaded the pbix. and your solution works for the sample data. However, it returned null values for my actual dataset.
must be the if()? could be that my IDs are text not numerical?- Jihwan_Kim5 years agoSuper User
Hi, Anonymous
Thank you for your feedback.
in my sample, ID is a number format.
If your ID column is a text format, please try writing something like below.
"1" "2" ...
Thank you.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM