Home > Net >  Reverse the Index Column in Power Query
Reverse the Index Column in Power Query

Time:04-03

I have a set of data of column fetching from API to that i've added an index column which start from 1 incrementing order. For ex I have a Index Column 1-50 if i tried to reverse it or sort it means the other columns are also getting reversed or sorted. But i need the Index column only to get reversed or sorted Image

In the above image i've to reverse only the Race not the other three columns.

CodePudding user response:

In powerquery, to reverse an index column

#"ReverseIndex" = Table.TransformColumns(#"PriorStepName",{{"Index", each Table.RowCount(#"PriorStepName")-_, Int64.Type}})

Or just use an index that counts in reverse to start with:

#"Added Index" = Table.AddIndexColumn(#"PriorStepName", "Index", Table.RowCount(#"PriorStepName"), -1, Int64.Type)

CodePudding user response:

  1. Select only index column which you need to sort without other columns
  2. do sort
  3. select "Continue with the current selection"
  4. click Sort button sort
  • Related