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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
saranp780
Helper III
Helper III

How to gathering data into column?

Hi guys, I'm quite new to Power BI so I need some help from you.

 

I have collected some data about computer specification. But the data isn't organized as I have shown on this page.

 

Serial3500013650
OSWindow10
CPUIntel Core i5
Clock2.4GHz
RAM4GB
Serial350001361
OSWindow10
CPUIntel Core i5
Clock2.4GHz
RAM4GB
Serial350001362
OSWindow10 Pro
CPUIntel Core i7
Clock2.4GHz
RAM8GB

 

My requirement is I want to organize them by moving some data that is the same type into their column as an example.

 

SerialOSCPUClockRAM
3500013650Window10Intel Core i52.4GHz4GB
350001361Window10Intel Core i52.4GHz4GB
350001362Window10 ProIntel Core i72.4GHz8GB

 

Please help me to solve this so I'm not sure this can be done in the Query Editor in Power BI or not? Or I have to do in other software, and what's name of the Program?

 

Thank you so much.

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @saranp780 ,

 

At first, you need to import it and set two column names. Open query editor.1-1.PNG

Then add an index column.1-2.PNG

Pivot column Type. Do not aggregate value.1-3.PNG

Then you can get the following table.1-4.PNG

Select column OS -> hold down shift -> left-click on column RAM. Go to the tab Transform -> select Fill -> press Up.
Filter out null values from column Serial. Remove index column. Click Close & Apply.1-5.PNG

Here is the all codes in the Advanced Editor.

let
   Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tykzMUdJRMjY1MDAwNDYzNVCK1YlW8g8GioVn5qXklxtCRJwDQoFCnnklqTkKzvlFqQqZphDxnPzkbKCMkZ6Ju0cVWCjI0RcoYOLuBOZhWGFIcxuMMG1QCCjKx2GLOX5bLEC2xAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"(blank)", "Type"}, {"(blank).1", "value"}}),
    #"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 0, 1),
    #"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Type]), "Type", "value"),
    #"Filled Up" = Table.FillUp(#"Pivoted Column",{"OS", "CPU", "Clock", "RAM"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Up", each ([Serial] <> null)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Index"})
in
    #"Removed Columns"

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @saranp780 ,

 

At first, you need to import it and set two column names. Open query editor.1-1.PNG

Then add an index column.1-2.PNG

Pivot column Type. Do not aggregate value.1-3.PNG

Then you can get the following table.1-4.PNG

Select column OS -> hold down shift -> left-click on column RAM. Go to the tab Transform -> select Fill -> press Up.
Filter out null values from column Serial. Remove index column. Click Close & Apply.1-5.PNG

Here is the all codes in the Advanced Editor.

let
   Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tykzMUdJRMjY1MDAwNDYzNVCK1YlW8g8GioVn5qXklxtCRJwDQoFCnnklqTkKzvlFqQqZphDxnPzkbKCMkZ6Ju0cVWCjI0RcoYOLuBOZhWGFIcxuMMG1QCCjKx2GLOX5bLEC2xAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"(blank)", "Type"}, {"(blank).1", "value"}}),
    #"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 0, 1),
    #"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Type]), "Type", "value"),
    #"Filled Up" = Table.FillUp(#"Pivoted Column",{"OS", "CPU", "Clock", "RAM"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Up", each ([Serial] <> null)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Index"})
in
    #"Removed Columns"

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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