Power Query - Return column name each time specific cell value is detected?

M, Johannes 86 Reputation points
2020-10-29T15:15:15.23+00:00

Hey guys!
I got this Table in the Power Query Editor. There are several Persons with different Attributes.
36142-3.png
How can I get my table in a format like this in the Power Query Editor? The first row schould be the person and the second is filled with the attributes were the value is one. They should be in a single row with a seperating figure.
36064-4.png
If you could help me that would be awesome and would safe my day!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
24,013 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,348 questions
{count} votes

Accepted answer
  1. Lz._ 8,801 Reputation points
    2020-10-29T16:18:49.44+00:00

    Hi

        PreviousStepName = ...
        UnpivotedOtherColumns = Table.UnpivotOtherColumns(PreviousStepName, {"Person"}, "Attribute", "Value"),
        FilteredValues = Table.SelectRows(UnpivotedOtherColumns, each ([Value] = 1)),
        GroupedRows = Table.Group(FilteredValues, {"Person"},
            {{"Attributes", each Text.Combine([Attribute],", "), type text}}
        )
    

0 additional answers

Sort by: Most helpful