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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bkazzaz
New Member

Repeat rows of column and display available values in other columns

Hello everyone,

 

The title may not explain what exactly i'm looking for. myself can't even get to understand how to describe it in my head. so i thought the best way to ask for help is to display the input and the result i'm trying to achieve in excel. 

 

here's what i currently have: 

 

bkazzaz_0-1621702033491.png

 

and here's what i'm trying to achieve:

bkazzaz_1-1621702087892.png

 

I have over 30 thousands products, with over 50 attributes that are set as headers, and values that are set as values. so i can't basically do anything manually. 

 

Thank you in advance. 

 

 

 

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @bkazzaz 

Simply select the Product column,  use "Unpivot other columns" and then filter out the blanks. Place the following M code in a blank query to see the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFyyilNBVJA5JuYA2UpxeoAZY0gnAhdn8SidKiMCVzWGMgKSk2BagAj0wpTpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Color = _t, Size = _t, Gender = _t, Number = _t, Dimension = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Color", type text}, {"Size", type text}, {"Gender", type text}, {"Number", Int64.Type}, {"Dimension", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Product"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> ""))
in
    #"Filtered Rows"

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @bkazzaz 

Simply select the Product column,  use "Unpivot other columns" and then filter out the blanks. Place the following M code in a blank query to see the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFyyilNBVJA5JuYA2UpxeoAZY0gnAhdn8SidKiMCVzWGMgKSk2BagAj0wpTpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Color = _t, Size = _t, Gender = _t, Number = _t, Dimension = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Color", type text}, {"Size", type text}, {"Gender", type text}, {"Number", Int64.Type}, {"Dimension", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Product"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> ""))
in
    #"Filtered Rows"

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Thank you so much @AlB . This was very quick solution. i really appreciate. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors