Table of Contents
Transposing a table in Power BI is a fundamental data transformation technique that involves rotating the axes of a dataset. Specifically, this process flips the rows and columns, allowing the data that was previously displayed horizontally across columns to be rearranged vertically into rows, and vice-versa. This is achieved efficiently by utilizing the “Transpose” feature found within the “Transform” tab of the Power Query Editor. Mastering this technique is crucial for effective data analysis and preparation, as many datasets imported into Power BI require restructuring before meaningful insights can be extracted.
Consider a scenario where you have a financial report organized with months listed as column headers (January, February, March) and specific metrics (Sales, Returns) listed as rows. By performing a Transposing operation, the months would become rows, and the metrics would become new columns. This transformation is exceptionally useful when the initial data format does not align with the requirements of Power BI’s native charting or visualization tools, especially when creating dynamic visualizations that depend on categorical fields being represented as rows.
The most streamlined and effective method for reorienting a table within Power BI involves leveraging the built-in Transpose functionality. This critical feature is housed directly under the Transform tab, accessible only within the dedicated environment of the Power Query Editor. Understanding how and when to apply this transformation is key to preparing complex datasets for modeling.

The following comprehensive tutorial will walk you through a practical, step-by-step example, illustrating precisely how to utilize this powerful feature to efficiently transform data structure.
Understanding Data Transposition in Business Intelligence
Transposition is not just a cosmetic change; it is a vital step in data preparation, particularly when dealing with datasets that are structured in a “wide” format. In data modeling, a wide table typically contains categories or attributes spread across columns, which can complicate measurement aggregation. The goal of transposition is often to move these categorical values from column headers into a single attribute column, thereby creating a “long” or normalized data structure, which is generally preferred for calculating metrics within Power BI’s data model.
The core challenge solved by transposition is restructuring data to meet the requirements of analytical tools. For instance, if years are columns (2018, 2019, 2020), it is difficult to calculate the average sales across all years using standard DAX functions. By transposing, these years become values within a single column (e.g., ‘Year’), allowing for easy filtering, slicing, and aggregation based on time series. This transformation fundamentally changes how the data interacts with the report canvas, enabling far greater flexibility in data analysis.
We will use an example dataset named my_data that currently displays annual sales and returns data in a wide format across six consecutive years. This format, while potentially easy to read in a spreadsheet, is suboptimal for dynamic reporting and comparative analysis in a Business Intelligence environment, necessitating the transposition operation.
The Need for Transposition: Wide vs. Long Data Formats
The distinction between wide and long data formats is central to understanding data transformation. A wide format table has distinct values that should be treated as categories occupying their own columns, as seen in our example where each year (2018 through 2023) is a separate column. A long format, also known as a tidy data format, converts these column headers into rows, resulting in fewer columns overall but many more rows, where variable names and their corresponding values are stacked vertically.
In our specific case, the original table shows the total Sales and Returns across different years. We aim to convert this structure so that the metrics (Sales and Returns) are displayed along the rows, and the Years are used as the new set of columns. This reorientation is sometimes necessary when the primary dimension for data analysis shifts from metrics to time periods, or when the data provider requires a specific pivot for reporting compliance.
Here is the initial structure of our dataset, my_data, illustrating the wide layout before transformation:

Our objective is to completely rotate the structure, transforming the table from this initial wide format into a normalized structure optimized for deeper metric comparison and enhanced visualization.
Specifically, we want the categories (Sales and Returns) to define the rows, and the temporal dimension (the Years) to define the columns.
Accessing the Power Query Editor
The process of transposition must be executed within the Power Query Editor, which acts as the dedicated Extract, Transform, Load (ETL) interface within Power BI Desktop. To begin the transformation, you must first navigate to this environment from the main application window, ensuring the target table is selected in the Fields pane.
To initiate the transformation sequence, locate the Home tab situated along the top ribbon interface of Power BI Desktop. Within this ribbon, click on the Transform data icon, which is usually found within the External data group. This action immediately launches a separate window containing the Power Query Editor, where all subsequent data manipulation steps will be performed and recorded as applied steps.
To open the transformation environment, click the Home tab along the top ribbon, then click the Transform data icon:

Executing this action successfully launches the dedicated Power Query Editor interface, where we will prepare and execute the transformation steps using the visual interface and M-language capabilities.
Step 1: Preparing Headers for Transposition
Before applying the Transpose function, a crucial preparatory step is required to ensure that the data intended to become the new column headers (in this case, the years) is captured within the data rows, rather than being treated as metadata. Since the Transpose operation flips everything, including headers, failing to prepare the headers will result in generic column naming (e.g., Column1, Column2) after the transformation, losing essential context.
The years (2018, 2019, etc.) are currently located in the first row of the data, but the Power Query Editor is treating them as formal column headers. To move them into the data body, navigate to the Transform tab within the Power Query Editor. Locate the “Use First Row as Headers” dropdown menu, click the arrow, and select the option labeled Use Headers as First Row.
Within the editor, click the Transform tab. Next, click the dropdown arrow located under the Use First Row as Headers section, and then select the command: Use Headers as First Row:

This critical intermediate step demotes the existing column headers, pushing them down into the first row of the data table. The editor automatically assigns generic column names (e.g., Column1, Column2, etc.) to replace the demoted headers. This temporary structure allows the header data (the years) to be correctly rotated during the subsequent transposition without being discarded or mislabeled.
Upon execution, the original headers will be successfully utilized as the first row of data, making them available for the rotation operation:

Step 2: Executing the Transpose Operation
With the headers successfully demoted to the first row, the table is now optimally prepared for the central transformation step: Transposing. This function is designed to mathematically flip the data matrix, turning every row into a column and every column into a row, while meticulously preserving the integrity, order, and content of the cells within the dataset.
Remain within the Transform tab of the Power Query Editor. The Transpose button is typically located prominently in the Table group toward the left side of the ribbon. Clicking this button executes the entire rotation instantly. It is important to anticipate that the resulting table will look dramatically different, featuring many fewer rows and many more columns than the original, wide format, which is the desired outcome of the process.
To perform the rotation, click the Transform tab once more, then locate and click the dedicated Transpose icon:

The result of this operation is a table where the original categories (Sales and Returns) are now located in the first column, and the years (2018 through 2023), which were previously the first row, are now spread horizontally across the subsequent columns (Column2, Column3, etc.). This interim state confirms that the rotation was successful, setting the stage for the final structural refinement: promoting the years back to their rightful position as column headers.

Step 3: Restoring Column Headers
While the data is now correctly oriented—rows representing metrics and columns representing years—the column names themselves are still generic (Column1, Column2, etc.). To make the table meaningful for downstream data analysis and data visualization, we must promote the row containing the year values back up to serve as the official, descriptive column headers.
This step essentially reverses the action taken in Step 1, but now applies it to the newly transposed data. Return to the Transform tab. This time, click the dropdown arrow under Use First Row as Headers, and explicitly select Use First Row as Headers. This operation instructs Power Query to take the contents of the current first row (which holds the years and the metric name) and elevate them to become the permanent, recognizable header names for the table.
Finally, click the Transform tab again. Locate the dropdown menu under Use First Row as Headers, and select the option Use First Row as Headers:

This conclusive action completes the structural transformation. The original year values (2018, 2019, 2020, etc.) are now correctly assigned as the column headers, providing clear context to the corresponding sales and return values beneath them. The table now features a structure that is rotated 90 degrees from the starting point and is optimized for the BI data model.
This ensures that the years present in the first row are correctly utilized as the definitive column names for the dataset:

Applying Changes and Finalizing the Transposed Table
Once all transformation steps are complete within the Power Query Editor—including the crucial sequence of demoting, transposing, and promoting headers—it is essential to load these changes back into the Power BI data model for reporting and visualization. Power Query maintains a sequence of applied steps on the right-hand panel, ensuring complete reproducibility and easy modification if future data source changes require adjustments.
To finalize the process, navigate to the Home tab within the Power Query Editor interface. Select the Close & Apply option, typically located on the far left of the ribbon. This command executes two functions simultaneously: it closes the editor window and applies all the recorded transformation steps to the underlying data source within the Power BI Desktop environment, triggering a refresh of the data model.
As you exit the Power Query Editor, a confirmation dialogue box will appear, prompting you to confirm whether you wish to apply the changes made to the query, which can take time depending on the dataset size.
Confirming the application of changes is crucial. Once confirmed by clicking Yes, the original table in the Power BI model view is overwritten by the new, transposed structure. This final dataset is now ready for efficient use in report building, allowing designers to easily compare metrics across time periods defined by the new column headers, optimizing the model for faster calculations.
Once you click Yes, the original table structure is updated to reflect the successful transposition:

Common Use Cases and Best Practices for Transposing Data
Transposing data is a powerful but specific tool. It is most commonly used when data sources deliver tables where measurement metrics are listed vertically (in rows) and categorical dimensions (like time periods, regions, or products) are spread horizontally (in columns). This “cross-tabulated” structure is often difficult to work with in standard relational databases or BI tools like Power BI, which prefer measurements in columns and dimensions in rows.
A key best practice when using transposition is to ensure your data types are consistent after the operation. Since rows become columns, if your original row contained mixed data types (e.g., text descriptions and numeric values), the resulting column will inherit this mix, potentially requiring further data type conversion steps within the Power Query Editor. Always check the data type of the newly created columns immediately after transposition to prevent calculation errors.
It is important for data professionals to differentiate between transposing and unpivoting. While both move data from columns to rows, transposition flips the entire matrix, including the fixed column headers. Unpivoting is typically preferred when you want to convert multiple measure columns into two new columns (Attribute and Value), leaving key identifier columns intact. Transposing is best suited for scenarios, like the one demonstrated, where a complete rotation of the dataset is necessary to optimize the data model for metric aggregation and efficient reporting.
Further Exploration of Power BI Transformations
While transposition solves a specific structural problem, the Power Query Editor offers a vast array of other transformation capabilities that streamline the ETL process. For complex data models, users often combine transposition with unpivoting, merging, and grouping operations to achieve the ideal star schema structure required for high-performance reporting. These capabilities allow developers to handle nearly any raw data source structure.
The ability to clean, shape, and transform data is foundational to becoming proficient in Power BI. We encourage exploration of other essential transformation tutorials that address common challenges encountered during data preparation, such as handling missing values, standardizing text, or combining multiple data sources seamlessly using advanced Power Query functions. Mastering these tools ensures robust and scalable data visualization.
The following tutorials explain how to perform other common tasks in Power BI:
Cite this article
mohammed looti (2026). How to Transpose a Table in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-you-transpose-a-table-in-power-bi-with-example/
mohammed looti. "How to Transpose a Table in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 9 Jan. 2026, https://scales.arabpsychology.com/stats/how-do-you-transpose-a-table-in-power-bi-with-example/.
mohammed looti. "How to Transpose a Table in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-do-you-transpose-a-table-in-power-bi-with-example/.
mohammed looti (2026) 'How to Transpose a Table in Power BI: A Step-by-Step Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-you-transpose-a-table-in-power-bi-with-example/.
[1] mohammed looti, "How to Transpose a Table in Power BI: A Step-by-Step Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, January, 2026.
mohammed looti. How to Transpose a Table in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.
