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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors