Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need to generate a downtime report for devices. I have a database of support tickets. If a device is down, I have a ticket which includes the date of the problem and the number of hours of downtime.
The calculation would look something like this...
Sum of Downtime / DATEDIFF(MinDate, MaxDate, HOUR) = downtime percentage
I posted this question a while back and got this answer...
The problem with this solution is that it looks at the records filtered by the date slicer, rather than the date slicer itself. If I select January 1 - January 31 in the slicer, the earliest ticket might be January 10 and the latest ticket might be January 20, then the datediff is calculated based on the ticket dates rather than the date selected in the slicer.
Is there a way to get the values selected in the slicer?
Solved! Go to Solution.
Hi @asdfasdf3321g ,
Use the following code:
Measure = DATEDIFF(min(Table[Date]);MAX(Table[Date]);HOUR)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@asdfasdf3321g , Can you share sample data and sample output?
You can refer my blog for date diff: https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...
I had to look up a "calendar table" but that worked, thanks for pointing me in the right direction.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |