question

MJohannes-5125 avatar image
0 Votes"
MJohannes-5125 asked EllaNudell-3910 Suspended answered

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

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!

power-query-not-supportedoffice-excel-itpro
3.png (5.5 KiB)
4.png (5.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @
Just checking in to see if the information of Lz-3068 was helpful. Please let us know if you would like further assistance.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 Vote 1 ·

1 Answer

Lz-3068 avatar image
1 Vote"
Lz-3068 answered MJohannes-5125 commented

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}}
     )
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much again! This helped a lot.

0 Votes 0 ·