Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
Anonymous
Not applicable

*DAX QUERY - Converting a row into columns and columns into a row using DAX*

 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

 

LocationABCDE
City112345
City2678910
City31112131415
City41617181920

 

I would like to convert it to 

 

 City1City2City3City4
A161116
B271217
C381318
D491419
E5101520

 

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 = 

UNION (
SELECTCOLUMNS (
'[Table1]',
"Location",'Table1'[Location],
"NewColumnName", "[A]",
"Value", 'Tavble1'[A]

),

SELECTCOLUMNS (
'[Table1]',
"Location",'Table1'[Location],
"NewColumnName", "[B]",
"Value", 'Tavble1'[B]

))

 

Any help would be appreciated.

1 REPLY 1

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.