# Percentage of boolean value over time - Grafana

**URL:** <https://community.influxdata.com/t/percentage-of-boolean-value-over-time-grafana/26850>\
**Category:** Grafana\
**Tags:** grafana, query\
**Created:** [October 5, 2022, 2:01pm UTC](https://community.influxdata.com/t/percentage-of-boolean-value-over-time-grafana/26850 "2022-10-05T14:01:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![grant1](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/grant1/32/15107_2.png) [@grant1](https://community.influxdata.com/u/grant1)\
**Post date:** [June 29, 2023, 9:51am UTC](https://community.influxdata.com/t/percentage-of-boolean-value-over-time-grafana/26850/4 "2023-06-29T09:51:44Z")

</div>

@0803xiaoqiao

If you are using Flux, do any of these solutions help?

[Count how long a value is 1 or 0 (on or off)](https://community.influxdata.com/t/count-in-seconds-how-long-a-value-is-1/28554)  
[Calculating total ON or OFF time for a period (day, month, etc.).](https://community.influxdata.com/t/calculating-duration-of-boolean-events-using-flux/27966/6)  
[Computing duration of a state using events.duration function](https://community.influxdata.com/t/duration-and-order-of-each-state/29122)

---

_[View the full topic](https://community.influxdata.com/t/percentage-of-boolean-value-over-time-grafana/26850)._
