Results 1 to 3 of 3

Thread: Repeating column names

  1. #1

    Repeating column names

    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hey it's me again with a new question^^

    I have multiple columns with the same name but if i work with PQ it will change that to info1, info2, info3 which i do not want.
    Does anyone have a solution to have it like in the sample picture at the end? And yes i could make the 3 Name, Since, Info columns
    to one, but since i do already have a lot of rows i do not wanna have more.

    Thx Kaso
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Sample.PNG 
Views:	13 
Size:	8.1 KB 
ID:	6957  

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Hey Kaso,

    So this is actually an issue with the structure of Tables in Excel, not specifically Power Query. Excel Tables cannot have duplicated names for column headers, and Power Query follows the same rules. Even if you could make this work in Power Query (which you won't be able to do), writing it out to an Excel worksheet or the Data Model would turn them in Info1, Info2, etc..

    Having said this, you could fake it by:
    -landing the data to a table using the Info1, Info2, etc... names
    -create another "translation" table that maps Info1 to Info, etc...
    -create a set of VLOOKUP() functions in the row above your data table to look up the names you want
    -format that header row like the header row of the table
    -hide the header row of the table

    You'll lose the ability to filter, but at least you'll get the column names displaying that you are looking for.
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Thanks for your answer Ken,

    i kinda solved it for my purpose. For each time a item appears that already exists i add a space.
    Doing that i get info, info<1x space>, info<2x space> .. That way they all look the same and it does not affect anything.
    Works for now, but isn't rly what i was looking for^^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts