March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Need more assistance from the community.
I have a excel spreadsheet with Monitor data in it. It looks like this:
I would like to transform the data into this:
Here is my code so far:
let
Source = Csv.Document(File.Contents(" ....\Testing\Displays.csv"),[Delimiter=",", Columns=5, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Sorted Rows" = Table.Sort(#"Promoted Headers",{{"Computer", Order.Ascending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 0, 1, Int64.Type),
#"Removed Columns" = Table.RemoveColumns(#"Added Index",{"Manufacturer", "Model", "Description"})
in
#"Removed Columns"
I have tried other Merge Rows into One Row solutions from this community but with no success. Wonder if someone would assist me in flattening out my data.
Thank you in advance.😊
Solved! Go to Solution.
We always prefer a data sample rather than a picture.
Anyway, the strategy is to add an Index (per Computer category) then perform a pivot on this new Index column to create the new column headings.
Step1 Group by Computer with new column "all" (choose 'All Rows')
Step 2 Add New Column with code like:
Table.AddIndexColumn([all], "Count", 1, 1)
Step 3 Expand the New Column (return everything and we'll tidy up columns after)
Step 4 Remove redundant columns.
Step 5 Select "Count" column and Pivot (from the Transform menu). Choose the Values column and 'Don't aggregate'
That should be it.
-------------------------
Let me know how it goes as that's some reasonably advanced operations.
Here is a sample of my data
ComputerManufacturerModelDescriptionSerial Number
8WOODSDRIVE | ACR | ACER V243H | Generic PnP Monitor | LHG080334231 |
8WOODSDRIVE | ACR | ACER X233H | Generic PnP Monitor | LG1080204220 |
FFD001 | ACR | V277U | Generic PnP Monitor | TDCAA002852A |
FFD001 | GSM | 24MB35 | Generic PnP Monitor | 610NTMX00419 |
FFD001 | GSM | 24MB35 | Generic PnP Monitor | 610NTTQ00417 |
FFD601 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD602 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD603 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD604 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD605 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD606 | ACR | Acer H236HL | Generic PnP Monitor | LX1AA0034210 |
FFD607 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD608 | GSM | 24MB35 | Generic PnP Monitor | 609NTABCX552 |
FFD608 | GSM | 24MB35 | Generic PnP Monitor | 610NTSU00414 |
FFD609 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD610 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD612 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD613 | ACR | Acer B236HL | Generic PnP Monitor | LYXAA0014200 |
FFD613 | ACR | V233H | Generic PnP Monitor | LGT0C0444060 |
FFD614 | ACR | ACER V243H | Generic PnP Monitor | LHG080334231 |
FFD614 | ACR | V233H | Generic PnP Monitor | LGT0C0444060 |
FFD615 | ACR | ACER X233H | Generic PnP Monitor | LG1080204220 |
FFD616 | ACR | S240HL | Generic PnP Monitor | LU50D0128532 |
Hi,
Share the download link of the Excel file and in another tab of the file, show the expected result clearly.
We always prefer a data sample rather than a picture.
Anyway, the strategy is to add an Index (per Computer category) then perform a pivot on this new Index column to create the new column headings.
Step1 Group by Computer with new column "all" (choose 'All Rows')
Step 2 Add New Column with code like:
Table.AddIndexColumn([all], "Count", 1, 1)
Step 3 Expand the New Column (return everything and we'll tidy up columns after)
Step 4 Remove redundant columns.
Step 5 Select "Count" column and Pivot (from the Transform menu). Choose the Values column and 'Don't aggregate'
That should be it.
-------------------------
Let me know how it goes as that's some reasonably advanced operations.
Here is a sample of my data
ComputerManufacturerModelDescriptionSerial Number
8WOODSDRIVE | ACR | ACER V243H | Generic PnP Monitor | LHG080334231 |
8WOODSDRIVE | ACR | ACER X233H | Generic PnP Monitor | LG1080204220 |
FFD001 | ACR | V277U | Generic PnP Monitor | TDCAA002852A |
FFD001 | GSM | 24MB35 | Generic PnP Monitor | 610NTMX00419 |
FFD001 | GSM | 24MB35 | Generic PnP Monitor | 610NTTQ00417 |
FFD601 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD602 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD603 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD604 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD605 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD606 | ACR | Acer H236HL | Generic PnP Monitor | LX1AA0034210 |
FFD607 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD608 | GSM | 24MB35 | Generic PnP Monitor | 609NTABCX552 |
FFD608 | GSM | 24MB35 | Generic PnP Monitor | 610NTSU00414 |
FFD609 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD610 | ACR | Acer S231HL | Generic PnP Monitor | LNZ080024214 |
FFD612 | (Standard monitor types) | Generic Non-PnP Monitor | ||
FFD613 | ACR | Acer B236HL | Generic PnP Monitor | LYXAA0014200 |
FFD613 | ACR | V233H | Generic PnP Monitor | LGT0C0444060 |
FFD614 | ACR | ACER V243H | Generic PnP Monitor | LHG080334231 |
FFD614 | ACR | V233H | Generic PnP Monitor | LGT0C0444060 |
FFD615 | ACR | ACER X233H | Generic PnP Monitor | LG1080204220 |
FFD616 | ACR | S240HL | Generic PnP Monitor | LU50D0128532 |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |