July 23, 2021
Shifting A Column One Row Up In Power BI
For Power BI version 2.76.5678.782 (December 2019).
Shifting a column up or down for one row is something Power Query can’t do on it’s own. It’s nonetheless simple to do, just follow the steps below.
In our example our data looks like this.
We would like to shift the column up for one row.
First sort the columns of interest, in our example we sort column Date descending.
Make a new index column starting from 1 using Add Column > Index Column > From 1.
Make a second new index column starting from 0 using Add Column > Index Column > From 0.
Merge your query with itself using Merge queries based in the two new indices.
Expand the merged query for the AC column only.
Now you have a new AC column, duplicated from the old one with a shift of one row.