Power BI Table Transpose: How to Flip Rows and Columns
In this article
Transposing a table in Power BI swaps rows and columns, turning column headers into row values and vice versa. This is useful for reshaping data to match report layouts, align with pivot-style analysis, or prepare for visualizations that expect data in a different orientation. You must first load your data into Power Query Editor — transposing cannot be done directly in the report view. No additional tools or external software are required.
What You'll Need
- Power BI Desktop installed (latest version recommended)
- A dataset loaded into Power Query Editor with at least one column of headers and multiple rows of data
- Basic familiarity with navigating Power Query Editor (not the main report canvas)
Step-by-Step
- Open Power BI Desktop and load your dataset by selecting Get Data from the Home tab, then choosing your source (Excel, CSV, database, etc.). Click Load or Edit Query to open Power Query Editor.
- In Power Query Editor, locate the table you want to transpose in the Queries pane on the left. Click its name to select it. The data preview will appear in the main window.
- Look at the top ribbon. Find the Transform tab — it’s the second tab from the left, just after Home. Click it to activate the transform tools.
- In the Transform tab, find the Transpose button. It is located near the middle of the ribbon, under the Row group. Click Transpose. This flips your entire table: columns become rows, and rows become columns.
- After transposing, your first row (originally the column headers) is now data. To fix this, select the first row by clicking the row number on the left. Then, go to the Home tab and click Use First Row as Headers. This promotes the first row back to column headers, now correctly aligned with the transposed structure.
- Review the data preview to confirm the transposition worked. Each original column should now be a row, and each original row should appear as a column. Check for any unexpected data shifts, missing values, or duplicate headers.
- Once you’re satisfied, click Close & Apply in the top-left corner of Power Query Editor. This applies the changes to your dataset in the main report canvas.
- Switch to the Report view. Drag a new table visual onto the canvas and add the transposed fields. You’ll now see your data oriented with original rows as columns and vice versa.
Common Mistakes
- Transposing without promoting the first row back to headers, resulting in column names like "Column1", "Column2" — this makes the data unreadable and unusable in visuals.
- Transposing a table with mixed data types (e.g., text and numbers in the same column) after transposition, which may cause Power Query to infer incorrect data types for the new columns.
- Attempting to transpose in the Report view instead of Power Query Editor — transposing is not available there.
- Transposing a table with too many columns (e.g., 100+), which can cause performance issues or display limitations in Power BI’s table visuals.
- Forgetting to click Close & Apply after making changes, so the transpose doesn’t save and the original table remains unchanged in the report.
Tips
- Always duplicate your query before transposing (right-click the query in the Queries pane > Duplicate) to preserve the original structure for comparison or fallback.
- Use the View > Column Profiling option before and after transposing to verify data type consistency across the new columns.
- For large datasets, consider filtering out irrelevant rows before transposing to reduce processing time and avoid bloating your model.
- If you’re transposing for a matrix visual, ensure the resulting structure aligns with the matrix’s row and column expectations — transposed tables often fit better in matrix visuals than standard tables.
- After transposing, rename the new columns to be meaningful. Right-click the column header > Rename to replace auto-generated names like "Column1" with descriptive labels.
- If your data includes dates or numbers that should stay as their original types, check the data type icons (e.g., ABC, 123, $) in the column headers after transposing and change them manually if needed.
Troubleshooting
- Nothing changes after clicking Transpose — Ensure you selected the correct query in the Queries pane. If multiple queries exist, you may have selected the wrong one.
- After transposing, all columns show "Column1", "Column2" — You forgot to click Use First Row as Headers. Go back to Power Query Editor, select the first row, then apply the header command.
- Data appears corrupted or truncated — This often happens if the original table had mixed data types in a single column. Go back, use Transform > Format to standardize types before transposing.
- Power BI freezes or responds slowly — Large tables with hundreds of columns can overwhelm Power BI. Reduce the dataset size by filtering or removing unnecessary columns before transposing.
- Transposed data doesn’t appear in visuals — Check that you clicked Close & Apply. Also, verify the new columns are included in your visual by dragging them from the Fields pane.
- Power Query shows an error about incompatible types — This means some columns now contain conflicting data types after transposition. Use Transform > Change Type to manually set the data type for each new column.