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
AFra
Helper III
Helper III

Table transformation : columns become lines

Hi there, 

 

I have a 50.000 lines table with 23 columns such as : 

IDability Aability Bability C ability D
123451 1 
123461111
12347 1  

 

I'd like to transform this table so that I only have 3 columns : ID,ability, Available. The final result shoud be : 

IDAbilityAvailable
12345A1
12345B 
12345C1
12345D 
12346A1
12346B1
12346C1
12346D1
12347A 
12347B1
12347C 
12347D 

 

Is there a way to do this easily in powerbi? How? : ) 

Thanks in advance, 

Ana 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@AFra,

 

In Power Query, click on the ID column, and select Transform --> Unpivot Other Columns. Then rename the columns as desired.

 

DataInsights_0-1601994613290.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@AFra 

Paste the below code in a blank query in Power Query and follow the steps

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNjFV0lEyBGIFOB2rA5Exg4ogMEzGHEU9WE8sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"ability A" = _t, #"ability B" = _t, #"ability C " = _t, #"ability D" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID"}, "Attribute", "Value"),
    #"Trimmed Text" = Table.TransformColumns(#"Unpivoted Other Columns",{{"Attribute", Text.Trim, type text}}),
    #"Extracted Last Characters" = Table.TransformColumns(#"Trimmed Text", {{"Attribute", each Text.End(_, 1), type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Extracted Last Characters",{{"Attribute", "Ability"}, {"Value", "Avilable"}})
in
    #"Renamed Columns"

 

Fowmy_0-1601994986714.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

DataInsights
Super User
Super User

@AFra,

 

In Power Query, click on the ID column, and select Transform --> Unpivot Other Columns. Then rename the columns as desired.

 

DataInsights_0-1601994613290.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors