# How to count filtered rows in a power table

**URL:** <https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [May 7, 2022, 10:28pm UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332 "2022-05-07T22:28:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Check](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@Check](https://forum.inductiveautomation.com/u/Check)\
**Post date:** [May 7, 2022, 10:28pm UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/1 "2022-05-07T22:28:06Z")

</div>

I have a Vision power table with a filterable column. I have a label where I show the number of rows when the table is loaded\updated; I get the number of rows with getRowCount(), but it shows the TOTAL number of rows, and I only want the number of rows in the table when the user filters the data. I would appreciate any directions.

Thank you very much for your prompt responses. For those who are new to Ignition, here is how it works:

#Get the number of ALL rows in the table (both filtered and unfiltered.)  
data = event.source.parent.getComponent(‘Power Table’).data  
count = data.getRowCount()

#Get ONLY the number of rows currently being displayed on the table (filtered rows.)  
data = event.source.parent.getComponent(‘Power Table’).viewDataset  
count = data.getRowCount()

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 7, 2022, 10:57pm UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/2 "2022-05-07T22:57:36Z")

</div>

Check out the manual, [Vision - Power Table - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Vision+-+Power+Table)

There is a property view dataset that you can reference for length.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 7, 2022, 11:04pm UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/3 "2022-05-07T23:04:22Z")

</div>

Check `props.filter.results.data`. It gives an array of the filtered data.

![Table filter row count](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3a653851dcd9d61158fd3d71904de572a98d81d.gif)

My filtered rows display on top is using an expression binding:  
`len({../Table.props.filter.results.data})`

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 7, 2022, 11:29pm UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/4 "2022-05-07T23:29:19Z")

</div>

That’s assuming Perspective, he did say Power Table, which is Vision, Perspective’s table is called table, not power table. But, now he has both so he should be set either way. 🙂

---

<div class="post-metadata">

**Author:** ![Check](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@Check](https://forum.inductiveautomation.com/u/Check)\
**Post date:** [May 9, 2022, 3:08am UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/5 "2022-05-09T03:08:02Z")

</div>

Thank you, Transistor. I did not specify I am working in Vision.

---

<div class="post-metadata">

**Author:** ![Check](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@Check](https://forum.inductiveautomation.com/u/Check)\
**Post date:** [May 9, 2022, 3:09am UTC](https://forum.inductiveautomation.com/t/how-to-count-filtered-rows-in-a-power-table/59332/6 "2022-05-09T03:09:39Z")

</div>

> [@Check](#):
>
> viewDataset

Thank you, jlandwerlen. viewDataset is what I needed.
