Forum Discussion

jcarrier's avatar
jcarrier
Helper I
7 years ago
Solved

Power Query - Variable Row to Standardized Column Layout

I want to tranform the snapshot below with variable row to standardized column layout. This needs to be a Power Query solution. The desired layout is one name and address with respective accounts and values for each row. Any help is appreciated on this. Thanks!

 

 

Desired Layout:

Name / Address / Account1 / Cat1 / Cat2 / Cat3 / Cat4 / and so on...

Name1 / Address1 / Same Account1 / Value1a  / Value 1b / Value1c / Value1d / and so on...

Name2 / Address2 / Same Account1 / Value1a  / Value 1b / Value1c / Value1d / and so on...

  • Here is the solve on this.  It's slightly modified from the desired table above as it does not have the placeholder Account columns but the respective Account columns are easily identifiable.  The key is to merge the values columns by a unique delimliter, pivot, and split columns by same delimiter.  Just have to think about data differently a bit.

3 Replies

    • jcarrier's avatar
      jcarrier
      Helper I

      The layout has to be standardized regardless of the number of variable accounts for each name.  Here is a truncated snapshot of the desired layout.  Hope that helps.

       

      • jcarrier's avatar
        jcarrier
        Helper I

        Here is the solve on this.  It's slightly modified from the desired table above as it does not have the placeholder Account columns but the respective Account columns are easily identifiable.  The key is to merge the values columns by a unique delimliter, pivot, and split columns by same delimiter.  Just have to think about data differently a bit.