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
EimearC
Frequent Visitor

Add sub-index to column

Hi there, 

I'm trying to add a sub-index to a column, I have gotten it so far below but cannot work out how to increment the 'Upper' column by 1 so that looking at the 'Tasks' column where it is in uppercase is the beginning of the index. So where there is an uppercase the 'Upper' column begins at 1 then each below should be 2, 3 etc & where the next uppercase row is, it reverts back to 1 then the numbering sequence begins again. Sample below of current & expected result. 

Hoping someone will be able to assist me 🙂 

 

Current

EimearC_0-1680220975041.png

Result

EimearC_1-1680221005394.png

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep= Table.FromRecords(List.Accumulate(Table.ToRecords(PreviousStepName),{{},0},(x,y)=>let a=if Text.Remove(y[Tasks],{"a".."z"})=y[Tasks] then 1 else x{1}+1 in {x{0}&{y&[Upper=a]},a}){0})

View solution in original post

2 REPLIES 2
EimearC
Frequent Visitor

Thank you so much @wdx223_Daniel  Works perfectly!

wdx223_Daniel
Super User
Super User

NewStep= Table.FromRecords(List.Accumulate(Table.ToRecords(PreviousStepName),{{},0},(x,y)=>let a=if Text.Remove(y[Tasks],{"a".."z"})=y[Tasks] then 1 else x{1}+1 in {x{0}&{y&[Upper=a]},a}){0})

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
Top Kudoed Authors