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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Table visual rows count

Hello ,
you got any solution for adding sr. no in table visual , I stuck with same probleam like i want to show total number of rows in the table visual but for some column i used aggregate function like sum ,

want to display total rows in the table visual likeppao.PNG
Regards ,

Pooja

 

Any suggetion ,

1 ACCEPTED SOLUTION

@Anonymous

 

Try with this MEASURE

 

Bacially try putting all the row fields inside Summarize function

 

MEASURE =
COUNTROWS (
    SUMMARIZE (
        TableName[G/L Account],
        TableName[Customer],
        TableName[Assignment],
        TableName[Document number],
        TableName[Type],
        TableName[Posting Date],
        TableName[Year/Month],
        TableName[Year],
        TableName[BusA],
        TableName[Dos Date],
        TableName[Reference],
        TableName[PK]
    )
)

View solution in original post

14 REPLIES 14
Martaspg
Advocate I
Advocate I

Hello,

I usually create a column called "nrows" with all values 1. Then you can put that variable in any visual and indicates the number of rows. It's simpler than to use CALCULATE when you have many columns.

You can generate it in query (new column [nrwos]=1) or as a calcualted column [nrows]=1.

I hope it helps

 

v-juanli-msft
Community Support
Community Support

Hi @Anonymous

As Greg_Deckler said, the measure can calculate the total rows of the table depite some column you used aggregate function like sum.

7.png

 

However, the total value can't show at the top of the table.

 

Best Regards

Maggie

Anonymous
Not applicable

@v-juanli-msft

Thanks for Reply,

Want to show on Card visual.

Pooja

@Anonymous

 

Try with this MEASURE

 

Bacially try putting all the row fields inside Summarize function

 

MEASURE =
COUNTROWS (
    SUMMARIZE (
        TableName[G/L Account],
        TableName[Customer],
        TableName[Assignment],
        TableName[Document number],
        TableName[Type],
        TableName[Posting Date],
        TableName[Year/Month],
        TableName[Year],
        TableName[BusA],
        TableName[Dos Date],
        TableName[Reference],
        TableName[PK]
    )
)

You need to define a measure that count the number of distintct elements of the elements that you are using in the visual table. Try the following, for a visual table that hast N columns in it would be

COUNTROWS(GROUPBY('table'[columnA],[columnB],...,[columnN]))

  

Hello,
I want to see how many rows are in the table visual in PBI. The measure COUNTROWS(table) will give me all the rows present in the table, which I don't want. I just want to see the total rows in the visual, how can I do that?
Thanks

pthapa

Greg_Deckler
Super User
Super User

You should just be able to create a measure like:

 

MyCount = COUNTROWS('Table')

or maybe

MyCount = COUNTROWS(CALCULATETABLE('Table'))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hello Greg,
I wanted to see  the total rows present in the table/matrix visual not the entire rows present in the model.

Example, I have a table visual with Customer No 1001,1002,1003 with their sales, now when you put them in the table visual, there are only 3 rows present in the visual. But if I use the dax COUNTROWS(), this will give me the count of rows for the entrie model for specific customer No, which I don't want. I want to show only 3 since I have only 3 rows in the visual. 
Hope this make sense. Can you please help.
Thanks,

pthapa

Anonymous
Not applicable

if the visual involves multiple tables data....this wont work..so how do we get count of rows in visual that is sourced from multiple tables and multiple filters? should we create a another kpi visual which will show count of rows and apply same fileds and filters?

Anonymous
Not applicable

if the visual involves multiple tables data....this wont work..so how do we get count of rows in visual that is sourced from multiple tables and multiple filters? should we create a another kpi visual which will show count of rows and apply same fileds and filters?

Anonymous
Not applicable

Hello@Greg_Deckler

By this measure how can count Total no of rows in the visual.

Cant tack directly becouse of  tack sum of Amount balance column (group by), so some no of rows in excel sheet  get minimize the count then visual table.

want to show table visual count of rows.

Regards ,
Pooja

 

Hi @Anonymous

Yes, it can display on a card chart.

Measure = COUNTROWS(Sheet1)

If you have 10 rows in the excel, when import to Power BI, your table shows 10 rows, then the function "COUNTROWS" will count all rows of your table despite you use any aggregation in the column.

But if the number of rows in the excel is 8, then the table in Power BI shows 8 rows, you can't get more than 8 using "COUNTROWS" 

 

 

Best Regards

Maggie

Anonymous
Not applicable

Hi @v-juanli-msftIf the number of rows in the excel is 8, then the table in Power BI shows 8 rows, you can't get more than 8 using "COUNTROWS" - Yes i kown , thats the issue i want to consider aggregate function and then count the rows .

If  the number of rows in excel is 8 import data in power bi Rows are 8 fine ,when we aggregate its less then 8,
hope you unstustand 

Pooja


.

 

Anonymous
Not applicable

Hello@Greg_Deckler

By this measure how can count Total no of rows in the visual.

Cant tack directly becouse of  tack sum of Amount balance column (group by), so some no of rows in excel sheet  get minimize the count then visual table.

want to show table visual count of rows.
Regards ,
Pooja

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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