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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AW1976NOVA
Post Patron
Post Patron

How to add row numbers to a table visual

Hi,

 

I have what seems to be a simple question:   Is there a way to add rows numbers to a table visual?

 

The table visual in question is populated by fields from multiple tables.  Also, I tried using the rank function but it takes soooo long to process for me...it's just not what I need.  

 

Is there any other way to accomplish this?  I want the table visual to populate with a 1 on row 1, 2 for row 2 and 3 for row 3 etc etc.  I'll be slicing and dicing the table visual by using slicers at the top of the page along with clicking on other visuals.

 

I'd like to add this "row count" to my MDC table below:

Capture.PNG

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@AW1976NOVA , You can not add row numbers to the table yet. 

Refer this blog , how can use workaround

https://radacad.com/generating-row-number-in-power-bi-visualization-using-dax

 

 

I logged an idea for that


Serial No in Visual Table
https://ideas.powerbi.com/ideas/idea/?ideaid=80612ec5-14a9-4929-a2ee-531943fa51d4

View solution in original post

Harisai9315
Helper I
Helper I

Dear Power BI aspirant, 

 

How to Add a Row Number in a Power BI Desktop Table Visual? 

 

SCENARIO:
- You have added data from fields in your Table visual.

- There are many (hundreds/thousands) of rows, but there is no number for each row. 

- You want to add a number beside each row by adding a Number Column from your fields. 

- You have not created any number columns as yet. 

 

SOLUTION 

- Create a New Measure

- Input DAX Formula below

 

DAX FORMULA

Row_Number =
CALCULATE (
DISTINCTCOUNT(TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED]),
FILTER(ALLSELECTED(TABLE), TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED] <= MAX(TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED]))
)

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

 

View solution in original post

2 REPLIES 2
Harisai9315
Helper I
Helper I

Dear Power BI aspirant, 

 

How to Add a Row Number in a Power BI Desktop Table Visual? 

 

SCENARIO:
- You have added data from fields in your Table visual.

- There are many (hundreds/thousands) of rows, but there is no number for each row. 

- You want to add a number beside each row by adding a Number Column from your fields. 

- You have not created any number columns as yet. 

 

SOLUTION 

- Create a New Measure

- Input DAX Formula below

 

DAX FORMULA

Row_Number =
CALCULATE (
DISTINCTCOUNT(TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED]),
FILTER(ALLSELECTED(TABLE), TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED] <= MAX(TABLE[COLUMN WHICH NEEDS ITS ROWS TO BE COUNTED]))
)

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

 

amitchandak
Super User
Super User

@AW1976NOVA , You can not add row numbers to the table yet. 

Refer this blog , how can use workaround

https://radacad.com/generating-row-number-in-power-bi-visualization-using-dax

 

 

I logged an idea for that


Serial No in Visual Table
https://ideas.powerbi.com/ideas/idea/?ideaid=80612ec5-14a9-4929-a2ee-531943fa51d4

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors