Skip to main content

How can I transform a Power BI table with columns like Date/city/state, measure, and Value (measure value), where the measure column has values like sales, cost, and margin so that the measure values are in columns instead of rows?

Table of Contents

One way to maintain the table structure without changing it is by using the Matrix visual and adding Measures as column fields.

The pivot option in Power Query can be used to transform the table structure. Here are the steps:

  1. Under the Home tab, click Transform Data to open the Power Query Editor.
  2. In the Power Query Editor, select the Measure column.
  3. In the Transform tab, find and click on the Pivot Column option.
  4. In the Pivot Column window, select Measure Value from the Values Column dropdown.
  5. Choose the appropriate aggregation function (such as sum or average) for the pivot operation.
  6. Click OK to apply the pivot transformation.
  7. Once pivoted, the measure values will appear as columns. You can rename these columns to more meaningful names if needed.

Add comment