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 Columns | Apples | Oranges | Bananas |
1 | 2 | 3 | 4 |
4 | 2 | 1 | 2 |
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 Columns | Attribute | Value |
1 | Apples | 2 |
4 | Apples | 2 |
1 | Oranges | 3 |
4 | Oranges | 1 |
1 | Bananas | 4 |
4 | Bananas | 2 |
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.