Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I need to create an uptime report. I have the downtime data, which includes a device ID, date of downtime, hours of downtime, and some other fields for the technical details.
A simple calulation will get me the uptime percentage...
Uptime % = (Total Hours - Downtime Hours) / Total Hours
Where Total Hours = the total numbers of hours in a date range. The date range is specified by a date slicer.
How do I get Total Hours from the slicer and into a formula for this calculation?
Solved! Go to Solution.
Hi @asdfasdf3321g ,
You can create measure like DAX below:
Total Hours= Var MinDate = CALCULATE(MIN(CalendarDate[Date]),ALLSELECTED(CalendarDate[Date])) Var MaxDate = CALCULATE(MAX(CalendarDate[Date]),ALLSELECTED(CalendarDate[Date])) Return DATEDIFF(MinDate, MaxDate, HOUR)
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @asdfasdf3321g ,
Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
Hi @asdfasdf3321g ,
You can create measure like DAX below:
Total Hours= Var MinDate = CALCULATE(MIN(CalendarDate[Date]),ALLSELECTED(CalendarDate[Date])) Var MaxDate = CALCULATE(MAX(CalendarDate[Date]),ALLSELECTED(CalendarDate[Date])) Return DATEDIFF(MinDate, MaxDate, HOUR)
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.