Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I am trying to Transpose data using DAX rather than the power query method but finding it tricky to convert a single row into multiple columns whilst turning several columns into rows.
As an example my table is as follows
Location | A | B | C | D | E |
City1 | 1 | 2 | 3 | 4 | 5 |
City2 | 6 | 7 | 8 | 9 | 10 |
City3 | 11 | 12 | 13 | 14 | 15 |
City4 | 16 | 17 | 18 | 19 | 20 |
I would like to convert it to
City1 | City2 | City3 | City4 | |
A | 1 | 6 | 11 | 16 |
B | 2 | 7 | 12 | 17 |
C | 3 | 8 | 13 | 18 |
D | 4 | 9 | 14 | 19 |
E | 5 | 10 | 15 | 20 |
I managed to convert the columns into rows using the UNION and SELECTCOLUMNS but don't know how to transpose the location field into columns.
The formula I have used so far is as follows
NewTable =
),
))
Any help would be appreciated.
This should do the trick:
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |