cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Usinghal
Helper I
Helper I

Regarding multiple column headers

Hi

Is there any way that if we are importing some excel files from sharepoint and those files may contain a column for which it has different names, so how we can apply condition of 'OR' on that column

Thanks

1 ACCEPTED SOLUTION

I think I understand.

Have a look at the attached PBIX file.

 

Specifically, the last two steps in the 'Final' query.

let
  Source = StoreA,
  #"Appended Query" = Table.Combine(
    {Table.Skip(Table.DemoteHeaders(Source), 1), Table.Skip(Table.DemoteHeaders(StoreB), 1)}
  ),
  Custom1 = Table.RenameColumns(
    #"Appended Query",
    List.Zip({Table.ColumnNames(#"Appended Query"), PreferredColumnNames})
  )
in
  Custom1

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

View solution in original post

3 REPLIES 3
KNP
Super User
Super User

Your question isn't entirely clear to me.

Are you saying you are trying to combine files but some have different column names?

 

If this is the case, are they at least in the same order in every file?

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

See, basically suppose there are 10 tables from which we are importing data.

And we have 4 columns in every file but in 4 files the 1st column is "ID" and in other six files the first column name is "Global ID". So is there any way that when are applying operation on all the files simultaneously then we can consider either "ID" or "Global ID"

I think I understand.

Have a look at the attached PBIX file.

 

Specifically, the last two steps in the 'Final' query.

let
  Source = StoreA,
  #"Appended Query" = Table.Combine(
    {Table.Skip(Table.DemoteHeaders(Source), 1), Table.Skip(Table.DemoteHeaders(StoreB), 1)}
  ),
  Custom1 = Table.RenameColumns(
    #"Appended Query",
    List.Zip({Table.ColumnNames(#"Appended Query"), PreferredColumnNames})
  )
in
  Custom1

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors