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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Numbering Rows - Restart row count at each "new" value

Hi all,

 

I have data in column A and I need to number it, but I need the numbering to restart when there is a new value. See example below:

 

Column A 
ABC1
ABC2
ABC3
CDB1
CDB2
DCB1
ADB1
ADB2

 

My Column A data is coming from an ODBC database so it needs to stay connected so my data will refresh. Let me know if this doesn't make sense and I can try explaining it a different way.


Thanks!

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

I'd like to suggest you enter to query editor and use 'add index column' feature:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVorVwaSdXZxQaBdnCO3ogkTHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Column A" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column A", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column A"}, {{"Index", each Table.AddIndexColumn(_,"Index",1,1)[Index], type list}}),
    #"Expanded Count" = Table.ExpandListColumn(#"Grouped Rows", "Index")
in
    #"Expanded Count"

5.png

Notice: these index numbers will auto increased every time your records increased.
Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

Check out my Cthulu quick measure:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/td-p/509739

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors