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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rigoleto
Helper II
Helper II

How to add a sequence to a table with a ascending index column

 

I need to add a new column just like the screenshot shown, notice that I have a location called "INTERNO", I can find the same location in index 16, and Do I need to do is to assign the same value or sequence as the first one of the list, in this example "INTERNO" index 10 has 1, so I need to assign the same value to index 16 "INTERNO"

 

I really apreciate your help!!!

 

Sequence.png

2 REPLIES 2
Anonymous
Not applicable

@Rigoleto Use conditional column in Query editor --> add column tab and mention the sequence for each 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lYtBCoAwDAS/UnL2E0sNWilNuwYvJf//hlBf4G1mYOaU0lzZTGKb8lh1BRd3PcDcHPfSbHQQHXRd4dd3lmqfw4lxado1ScQL", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Location = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Location", type text}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Sequence", each if [Location] = "INTERNO" then 1 else if [Location] = "VOLTEAR" then 2 else if [Location] = "PEGARCNTAS" then 3 else if [Location] = "CORTARAPARTE" then 4 else if [Location] = "ATRAQJE DE " then 6 else if [Location] = "CORTARHILOS" then 5 else null),
#"Sorted Rows" = Table.Sort(#"Added Conditional Column",{{"Sequence", Order.Ascending}})
in
#"Sorted Rows" 

 

Hi MohanV,

 

I have noticed thta you added the Location like constant value, this values can change, it will related with the type of production process, there are some process greated than 15 operations, in other words it is dynamic, can I handle a dynamic logic in order to handle this process?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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