Forum Discussion

kfschaefer's avatar
kfschaefer
Helper IV
10 years ago
Solved

Reset INDEX order when data sort does not give the results

Looking for solution to reset the INDEX numbering to allow for self determined numbering when Data Asc order does not return the correct results.  See how the 3000+  comes before 501-3000.  is there ...
  • Eric_Zhang's avatar
    Eric_Zhang
    10 years ago

    kfschaefer wrote:

    thanks for the code, however, it seems to have and issue with the 4.


    kfschaefer

    I thought you were adding a column in the modeling lab with DAX, the switch is a DAX function.
    To add a column with the same logic in the Query Editor which Power Query is used, you can reference below expression.

     

    if [live range]="0-100" then 1 else(
      if [live range]="101-500" then 2 else(
      if [live range]="501-3000" then 3 else(
      if [live range]="3000+" then 4 else(
      if [live range]="New" then 5 else(
      if [live range]="Runout" then 6 else 999)))))

     

    If you have any question, feel free to let me know.