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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
mdubose
Helper I
Helper I

How to return the number of rows displayed in a visual

Hello,

 

I've created a report where I'm pulling columns from multiple tables.  These tables have a relationship.  I need to get the number of rows returned from my table visual.  I've tried creating a measure like this: Rows=COUNTROWS('Table A')+COUNTROWS('Table B').  This meaure is returning the number of rows in Table A and Table B in the database, not the number of rows in my visualization.  

 

For example, the measure returns 700 rows.  The number of rows in my visual is 100 rows.

 

How can I return the number of rows displayed in my visual?

 

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

hi @mdubose 

try like:
Count =
COUNTROWS(
    SUMMARIZE(
       TableA1,
       TableA[Case Number],
       TableA[Name First],
       TableA[Name Middle],
       TableA[Name Last],   
       TableB[Requester First Name],
       TableB[Requester Ladt Name]
)

View solution in original post

9 REPLIES 9
ppm1
Solution Sage
Solution Sage

If all of the columns used share a common fact table, you can use an expression like this to get your row count.

 

RowCount = COUNTROWS(SUMMARIZE(FactTable, Dim1[Column1], Dim2[Column2], ...))

 

Pat

Microsoft Employee
FreemanZ
Community Champion
Community Champion

hi @mdubose 

how does your table visual look like?

Below is a sample of my table visual. I want to get the count of rows in this table visual.

 

mdubose_0-1674270939911.png

 

FreemanZ
Community Champion
Community Champion

hi @mdubose  

which of the fields are columns and which are measure? How does the measure look like?

 

p.s. please consider @someone, if you seek further suggestions. 

Hi @FreemanZ ,

All the fields in the sample visual are columns.  I want to put my measure next to the word, "Count".  The DAX formula in the measure is this for example: Rows=COUNTROWS('Table A')+COUNTROWS('Table B').  What's returned from the DAX is 700 because it's counting the rows in Table A which is 500 plus counting the rows in Table B which is 200.  However, this formula doesn't return the actual number of rows displayed in my visual.

hi @micheledubose 

which of the columns are from Table A and which are from Table B? How are the two tables related or which table is on the many side?

Hi @FreemanZ ,

Below is an example of my table visual without displaying the values. 

 

mdubose_0-1674343471562.png

 

Columns Case Number to Name Last are from Table A.

Columns Requester First Name and Requester Last  Name are from Table B.

Table A is related to a different table called Table A1. Table A is one to many to Table A1. Table A1 is many to one to Table B.

FreemanZ
Community Champion
Community Champion

hi @mdubose 

try like:
Count =
COUNTROWS(
    SUMMARIZE(
       TableA1,
       TableA[Case Number],
       TableA[Name First],
       TableA[Name Middle],
       TableA[Name Last],   
       TableB[Requester First Name],
       TableB[Requester Ladt Name]
)

Hi @FreemanZ ,

 

That worked! Thanks!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.