Forum Discussion
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 | 1 |
| ABC126 | 0 |
| FFR556 | 1 |
| KKI998 | 0 |
| WWA324 | 1 |
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 1Appreaciate your kudos and acceptance of the solution if it works for you.
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?
3 Replies
- olgadResident Rockstar
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 1Appreaciate your kudos and acceptance of the solution if it works for you.
- GoatTrackerFrequent Visitor
Hi olgad I have hundreds not in sequential order unfortunately.
- olgadResident Rockstar
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?