UnPivot columns in Microsoft Power BI and your data may stop adding up

PowerBI

Unpivot Columns

In Power BI, Unpivot Columns transforms columns into rows with attributes and values. In other words, it changes the data structure and as a result it can change values in a visualization.

Other ColumnsApplesOrangesBananas
1234
4212

In the table above, we can sum the values in any of the columns. For example, The sum of the column named Other Columns is 5.

Other ColumnsAttributeValue
1Apples2
4Apples2
1Oranges3
4Oranges1
1Bananas4
4Bananas2

After the Apples, Oranges, and Bananas columns are unpivoted, the structure of the table has changed. A row is created for each Attribute (previous Column name) and Value. This extends to other columns. See how the left-most column has it’s values repeated. That is what happens to the data in the columns that remain pivoted. Now the sum of Other Columns appears to be 15.

If there was already a visualization on the report with the original value of Other Columns that value will change when columns are unpivoted.