# Dashboard - Count specific states

**URL:** <https://forums.losant.com/t/dashboard-count-specific-states/3488>\
**Category:** Help\
**Tags:** dashboard, workflow\
**Created:** [December 17, 2020, 8:38pm UTC](https://forums.losant.com/t/dashboard-count-specific-states/3488 "2020-12-17T20:38:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danny\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Danny\_Nguyen](https://forums.losant.com/u/Danny_Nguyen)\
**Post date:** [December 17, 2020, 8:38pm UTC](https://forums.losant.com/t/dashboard-count-specific-states/3488/1 "2020-12-17T20:38:30Z")

</div>

Hello,

I’m trying to create reports that counts up how many times a specific state occurred on a device.  
Right now, I have devices with an ‘activity’ attribute.

The activity attribute gets updated with different String states, such as “Open” “Motion” “Button pressed”

I want to count how many times the “Button pressed” state occurred in the past month on my device to show on a dashboard that I can use to create reports, but I’m not entirely sure where to start here. I can get total count of states on my device, but I can’t seem to sort out ‘filtering’ that count for specific states.

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [December 17, 2020, 10:16pm UTC](https://forums.losant.com/t/dashboard-count-specific-states/3488/3 "2020-12-17T22:16:18Z")

</div>

Hi @Danny_Nguyen,

This is a great question.

One workaround you can do is:

1. Add an attribute to this device with a name like “buttonPressCounter” or something similar.
2. Using a workflow, report `1` (or something similar) when the button is pressed
3. Use a count aggregation over a specific time period to get the number of times “buttonPressCounter” showed up

Although this is a workaround, I do think there is a Feature Request built in here. I’m going to create a feature request that will make this much easier. I will keep you updated as I learn more about it!

Please let me know if this makes sense or if you need any further help!

Thank you,  
Heath Blandford  
Customer Success Engineer

---

<div class="post-metadata">

**Author:** ![Danny\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Danny\_Nguyen](https://forums.losant.com/u/Danny_Nguyen)\
**Post date:** [December 18, 2020, 11:24pm UTC](https://forums.losant.com/t/dashboard-count-specific-states/3488/5 "2020-12-18T23:24:47Z")

</div>

Thanks for this Heath!  
I would love for it to be some sort of optional text input under a device - attribute query to match a string/number/boolean/etc.

If this could be done from within the dashboard to get live data reports, that would be fantastic. I can currently use all the dashboard blocks to count the total number, but I could create some killer value-add reports if we can do something like that.

Looking forward to seeing what you guys can do here!
