Forum Discussion
Need Help with Dynamic Row count Based on Table Visual and Slicers
- 8 months ago
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
- 8 months ago
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.
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
- v-dineshya8 months agoCommunity Support
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
- v-dineshya8 months agoCommunity Support
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