Forum Discussion

GoatTracker's avatar
GoatTracker
Frequent Visitor
3 years ago
Solved

Alternate number based on group

I'm looking to format the POWER QUERY table by group instead of by row.  My Code references are sorted in the query, how can I apply a new column like the example below?   Code Group ABC123 ...
  • olgad's avatar
    3 years ago

    Hi, how many codes you have, is there any logic in assigning group 1 or group 0? Conditional column will help you to create this column, 

    if it is 1 for the first row then 2 for the second 1 for the 3rd, 2 for the 4th then
    add index column first then custom column
    if (Number.IsEven([Index])=true) then 0 else 1

    Appreaciate your kudos and acceptance of the solution if it works for you.

  • olgad's avatar
    olgad
    3 years ago

    if index column and custom column 
    if (Number.IsEven([Index])=true) then 0 else 1
    is not an option, then please identify the logic based on which you want to assign group 1 group 0?