Forum Discussion
Anonymous
6 years agoNot applicable
Calculate last hour data
Hi all, I'm pretty new in Power BI, I'm seeking a solution calculate last specific hour. As I searched on Google, Power BI has a DATEADD function can help this but this function just only suppor...
- Anonymous6 years ago
Hi all,
I found the solution and want to share with you.
Please following this link.:
https://exceleratorbi.com.au/solving-a-complex-time-problem-in-power-bi/
az38
Community Champion
6 years agoAnonymous
what is your desired result for this data sample?
- Anonymous6 years agoNot applicable
Hi az38 ,
My desired result if last 2 hours is:
Time Count count last 2 hours 01/01/2018 10:00:00 PM 4 01/01/2018 11:00:00 PM 2 02/01/2018 12:00:00 AM 2 4 02/01/2018 01:00:00 AM 6 2 02/01/2018 02:00:00 AM 4 2 02/01/2018 03:00:00 AM 9 6 02/01/2018 04:00:00 AM 0 4 - az386 years ago
Community Champion
Anonymous
it depends on how you calculate count but try
Measure = CALCULATE(SUM([Count]), FILTER(ALL('Table'), DATEDIFF('Table'[Time], SELECTEDVALUE('Table'[Time]), HOUR)=2))- Anonymous6 years agoNot applicable
Hello Anonymous ,
I currently cannot get the desired result.
Let me clarify a little bit, It's similar like DATEADD but applied for HOUR.
I cannot use this function due to the Time field data has the duplicate date.