Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Patrick_Goh_YY
Regular Visitor

Calculating the number of rows in a created table visual

Hi folks

 

Needed some help over here.

I have created table visual showing multiple information. The number of rows in this table is dynamic, and it will change accordingly to the various slicers/ filters that I have in place.

 

My qn is - am I able to make a count on the number of rows in this table visual created, and use a card visual to display the row count.

The value will be dynamic (i.e. the rows in the table visual may change to 150, 265, 50, 32 and the card visual will display accordingly.)

Thank you so much in advance. 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Patrick_Goh_YY 

According to your description, you want to get the number of the table and the table will change accordingly to the various slicers/ filters that I have in place.

If only slicers exist for your table, then you only need to build a table with the same filtering context as your table using measures, and then use CountRows() to count.

Measure = COUNTROWS('Table')
vyueyunzhmsft_0-1682905325601.png

If you have a "Filter on this visual" filter, and you also need to dynamically display the counts in the current table on your cards. Then you can only guarantee that your "Filter on this visual" filtering is static and does not change, which is currently not possible if it is dynamic.

vyueyunzhmsft_1-1682905505018.png

For this case, we can write our static filtering logic to our measure and then get the corresponding number of rows in the table.

Measure 2 = COUNTROWS( FILTER( SUMMARIZE('Table','Table'[Column1],'Table'[Column2],"Sum" , SUM('Table'[Column3])) , [Sum]<=5))
 
The result is as follows:
vyueyunzhmsft_2-1682905572026.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Patrick_Goh_YY 

According to your description, you want to get the number of the table and the table will change accordingly to the various slicers/ filters that I have in place.

If only slicers exist for your table, then you only need to build a table with the same filtering context as your table using measures, and then use CountRows() to count.

Measure = COUNTROWS('Table')
vyueyunzhmsft_0-1682905325601.png

If you have a "Filter on this visual" filter, and you also need to dynamically display the counts in the current table on your cards. Then you can only guarantee that your "Filter on this visual" filtering is static and does not change, which is currently not possible if it is dynamic.

vyueyunzhmsft_1-1682905505018.png

For this case, we can write our static filtering logic to our measure and then get the corresponding number of rows in the table.

Measure 2 = COUNTROWS( FILTER( SUMMARIZE('Table','Table'[Column1],'Table'[Column2],"Sum" , SUM('Table'[Column3])) , [Sum]<=5))
 
The result is as follows:
vyueyunzhmsft_2-1682905572026.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.