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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Pradeep_12
New Member

Need Help with Dynamic Row count Based on Table Visual and Slicers

Hi Team,

I’m currently working on a project and there is a requirement to display the row count of a table visual.
The row count should update dynamically every time the user interacts with slicers.

Since the fields in the table visual are not static and change based on the user's slicer selection, the row count should also update accordingly and display the correct number of rows shown in the table visual.

Please help me with a solution that allows the row count to change dynamically based on slicer selections.

Thank you

 

2 ACCEPTED SOLUTIONS
FBergamaschi
Solution Sage
Solution Sage

Create a Measure

 

Nr Rows = COUNTROWS ( YourTable )

 

This will be dynamic and will feel slicers selections

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

View solution in original post

Selva-Salimi
Super User
Super User

Hi @Pradeep_12 ,

 

if your visual table is different from yout table you can write a measure as follows:

 

cnt = var tbl = summarize(your_table , [column1 in visual table] , [column 2 in visual table] ,...)

return

countrows(tbl)

 

if visual table is the same as your table you just need to write a measure like this:

 

cnt= countrows(your_table)

 

If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution ✔️ to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Shubham_rai955
Memorable Member
Memorable Member

Use a simple COUNTROWS over the key column (or a grouped set of columns) and show it in a Card; it will automatically respect all slicers and filters applied to the table visual.

Basic pattern (single table)

If the table visual is driven by one fact/dim table and each row is uniquely identified by a key (e.g. ID, TransactionID):

 
Visible Row Count := COUNTROWS ( VALUES ( 'YourTable'[RowKeyColumn] ) )
  • VALUES returns the distinct keys visible after slicers, page filters, and visual filters.

  • COUNTROWS over that list gives the exact row count of the current table visual.

When multiple columns define a row

If a “row” in the table is defined by a combination, e.g. Customer + Date:

 
Visible Row Count := COUNTROWS ( SUMMARIZE ( 'YourTable', 'YourTable'[Customer], 'YourTable'[Date] ) )
  • SUMMARIZE builds the same grouped grain as your visual, and COUNTROWS counts those groups after all slicers.

Use either measure in a Card visual; it will update dynamically whenever users change slicers or other filters.

Praful_Potphode
Solution Sage
Solution Sage

Hi @Pradeep_12 ,

 

This is the default behaviour of Power BI.

As suggested by @FBergamaschi , create a measure for row count and you're all good.

If you have rowcount and slicer columns from 2 different tables, make sure they are connected via relationships and can filter 

When ever you select anything in the slicer,it will filter the visualization created on the page.

if you want to turn it off you can use edit interactions.

 

Please give kudos or mark it solution once confirmed.

Thanks and Regards,

Praful

 

Olufemi7
Resolver III
Resolver III

Hi @Pradeep_12 

You can display a dynamic row count in Power BI Service that updates automatically whenever slicers are applied. The logic is the same as in Desktop, but once you publish the report to the Service, the measure continues to respect all slicers, page filters, and visual filters.

Example Dataset (Dummy Data)

Let’s assume you have a Sales table like this:

TransactionID Customer Region Date SalesAmount
1AliceEast01-Jan-24120
2BobWest02-Jan-24200
3CarolEast03-Jan-24150
4DavidNorth04-Jan-24180
5EmmaSouth05-Jan-24220
6FrankEast06-Jan-24130
7GraceWest07-Jan-24170

 

DAX Measures

1. Basic Row Count (works with slicers & filters):

Visible Row Count =
COUNTROWS ( VALUES ( Sales[TransactionID] ) )


2. Multiple Columns Define a Row (e.g., Customer + Date):

Visible Row Count =
COUNTROWS (
    SUMMARIZE ( Sales, Sales[Customer], Sales[Date] )
)

3. Simple Alternative (if table directly uses Sales rows):

Row Count = COUNTROWS ( Sales )

Demonstration Steps in Power BI Desktop

  1. Load the dataset above into Power BI (you can paste it into Excel and import, or enter manually).

  2. Create a Table visual showing Customer, Region, and SalesAmount.

  3. Add slicers for Region and Date.

  4. Create the Visible Row Count measure.

  5. Add a Card visual with the measure.

  6. Interact with slicers:

    • Select Region = East → Table shows 3 rows, Card shows 3.

    • Select Region = West → Table shows 2 rows, Card shows 2.

    • Clear slicers → Table shows all 7 rows, Card shows 7.

 

v-dineshya
Community Support
Community Support

Hi @Pradeep_12 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please try below measures.

 

1. Below measure Counts the number of rows currently visible in the table visual. This works with all slicers, page filters, and visual-level filters.


Visible Row Count =
COUNTROWS (
VALUES ( 'Table_name'[RowKeyColumn] )
)

 

Note: RowKeyColumn must uniquely identify a row in the table. (ID, TransactionID, OrderNo, etc). VALUES() respects all slicers & filters. Works even if columns shown in the table visual change.

 

Please follow below steps.

1. Create this as a measure.

2. Drag it in a Card visual

3. The number updates instantly with slicers


2. It shows the exact row count of the table visual after all visual filters, When Top N, measure filters, or complex visual filters are used.


Visible Row Count (Visual Accurate) =
COUNTROWS (
SUMMARIZE (
'Table_name',
'Table_name'[RowKeyColumn]
)
)


Note: Use Top N, use measure-based filters.


3. If your table uses multiple columns as a “row” (Customer + Date defines one row) , try below measure.

 

Visible Row Count =
COUNTROWS (
SUMMARIZE (
'Table_name',
'Table_name'[Customer],
'Table_name'[Date]
)
)


4. If your table visual is built from MEASURES only (no physical row column), then try below measure.

 

Visible Row Count =
COUNTROWS (
VALUES ( 'DimTable'[DisplayColumn] )
)

 

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Hi @Pradeep_12 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

Hi @Pradeep_12 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

Kedar_Pande
Super User
Super User

@Pradeep_12 

You don’t need anything fancy for this.

Row Count =
COUNTROWS ( FactTable )

 

If the table can show rows from different tables or via a field parameter, use ALLSELECTED on the main table behind the visual:

Row Count =
COUNTROWS (
ALLSELECTED ( FactTable )
)

 

Put that in a Card, align it above the table, and you’re done.

 

 

If this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

Selva-Salimi
Super User
Super User

Hi @Pradeep_12 ,

 

if your visual table is different from yout table you can write a measure as follows:

 

cnt = var tbl = summarize(your_table , [column1 in visual table] , [column 2 in visual table] ,...)

return

countrows(tbl)

 

if visual table is the same as your table you just need to write a measure like this:

 

cnt= countrows(your_table)

 

If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution ✔️ to help the other members find it more quickly.

FBergamaschi
Solution Sage
Solution Sage

Create a Measure

 

Nr Rows = COUNTROWS ( YourTable )

 

This will be dynamic and will feel slicers selections

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.