Search code examples
excelpowerqueryconditional-formatting

Power Query: alternating highlighting based on row values


So my column is sorted in ascending order. I want the 000001s to be highlighted the same color and for the 000002s to be highlighted another color. enter image description here

What’s the best and most efficient way to go about this?


Solution

  • Powerquery does not do formatting / highlighting. If you want, add a column that alternates 0 / 1 and use that to set up a conditional format:

    In powerquery

    right click ... group by ... use operation all rows

    enter image description here

    add column .. index column

    Click select index column and standard ... modulo ... 2..

    enter image description here

    Click select the arrow atop the grouped column and expand

    right click and remove extra columns then file... close and load back to excel...

    enter image description here

    use that to set up conditional formatting in excel (image does not match new data, but same theory)

    enter image description here

    and copy to all ranges

    enter image description here