Reply
Member
Posts: 132
Registered: ‎03-07-2018
Accepted Solution

how to add serial number / row number in the visual?

[ Edited ]

Hi, how can i achieve this in my visual?  I cannot add the add column starting with 1 for this since that will be static. I need the row numbers for the visual so that it changes dynamically. Capture.PNG


Accepted Solutions
Super User
Posts: 668
Registered: ‎11-01-2017

Re: how to add serial number / row number in the visual?

You can add a index column in Power Query which will have unique value and then use above logic based on index value.

 

Thanks
Raj

View solution in original post


All Replies
Super User
Posts: 668
Registered: ‎11-01-2017

Re: how to add serial number / row number in the visual?

Try this

 

rownum = CALCULATE(COUNTROWS(Table1),FILTER(ALLSELECTED(Table1),Table1[Name]<=MAX(Table1[Name])))

 

Thanks

Raj

Member
Posts: 132
Registered: ‎03-07-2018

Re: how to add serial number / row number in the visual?

I tried this already (got it from other post). It does not work in my case because I don’t have unique ID/name . It repeated. So if ID 1 has name abc repeated twice I will see 2,2 as row number for them instead of 1,2. Makes sense?
Established Member
Posts: 227
Registered: ‎07-13-2018

Re: how to add serial number / row number in the visual?

Super User
Posts: 668
Registered: ‎11-01-2017

Re: how to add serial number / row number in the visual?

You can add a index column in Power Query which will have unique value and then use above logic based on index value.

 

Thanks
Raj

Highlighted
Member
Posts: 132
Registered: ‎03-07-2018

Re: how to add serial number / row number in the visual?

Yep. It works that way! Thanks!