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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
gc_abby
New Member

Converting column names as row values using DAX

I have a table Table 1 having these below columns (A1, B1, C2, A2, B2, C2). 

I need to create another table Table 2 with A, B and C as row values under the column "Type" and  two other columns, 1 and 2 under which I should have the sum(A1), sum(A2) and so on.

 

Table 1 

A1 B1 C1 A2 B2 C2

- - - - ----

- - - ------

- - --------

 

Table 2

Type     1      2

  A      Sum(all values under A1)

  B

  C

2 REPLIES 2
Anonymous
Not applicable

Mate, such tasks belong to the ETL world rather than DAX. Please use Power Query for this (as rightly suggested by the other reader).

 

Best

Darek

HotChilli
Super User
Super User

In Power Query:

Select all columns.

Unpivot them.

This should give you 2 columns (the first will have A1, B1, C1 etc).

Split the first column (by number of characters - which will be 1, as far left as possible).

This will give you 3 columns.

Select the middle column.

Pivot the column.

Rename your columns as required.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.