Power BI: Unpivot Columns for Clear Data

In dit artikel

In Power BI, data is often provided in a wide format, where multiple columns contain similar information. This makes analysis difficult and unclear. In this article, you will learn how to apply unpivot columns in Power BI to transform your data into a long format, which brings clarity and flexibility to your reports. This is essential for data and BI teams who want to work more efficiently with their datasets.

 

What You Need

  • A dataset with multiple columns containing similar data (for example, monthly sales figures per product in separate columns).
  • Access to Power BI Desktop to use Power Query for data transformation.

 

Step 1: Open Power Query and Select the Columns

Open your Power BI Desktop file and go to the Power Query Editor via ‘Transform Data’. In your table, select the columns you want to unpivot. These are usually the columns with similar data that you want to combine into one column.

 

Step 2: Perform the Unpivot Action

With the desired columns selected, right-click and choose Unpivot Columns. Power Query will now convert the selected columns into two columns: one with the original column names and one with the corresponding values. This makes your dataset clearer and suitable for further analysis.

 

Step 3: Adjust Column Names and Data Types

After unpivoting, it is important to give the new columns clear names, for example ‘Month’ for the column names and ‘Value’ for the data. Also, check that the data types are set correctly, for example text for the month and number for the value. This prevents errors in your reports.

 

Tips & Common Mistakes

  • Tip: Use unpivot only on columns with similar data to avoid making your model unnecessarily complex.
  • Mistake: Don’t forget to adjust data types after unpivoting, as this can lead to errors in visuals.
  • Tip: Make a backup of your original data before performing major transformations.

 

Example / Mini Use Case

Suppose you have a sales report with columns for each month: January, February, March, etc. By unpivoting these columns, you create one column ‘Month’ and one column ‘Sales Value’. This allows you to easily analyze trends, apply filters, and create visuals that provide insight per month.

 

Conclusion

By unpivoting columns in Power BI, you transform your data into a clear and analysis-friendly format. This helps you gain insights faster and create better reports. Want to learn more about structuring data? Check out the article Power BI: Combining Columns with Power Query. You can easily apply these transformations directly in Power BI Desktop or the online environment.

More posts

Looking for help?

We love to help you!

Feel free to contact us.

Foto van Brendan den Hartog

Author

Stijlelement

Spreek een van onze Power Platform Experts

CTA Plan een demo
Stijlelement