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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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]
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

11 REPLIES 11
Martaspg
Frequent Visitor

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]
    )
)

Regards
Zubair

Please try my custom visuals
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'))

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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