Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
T-Pan
Helper I
Helper I

Get data from folder issue.

Hello everyone, on my job i have to create a report which will be updated daily with the excels in picture below. As you will see, all columns of these excels have the same Column names except the second column. So if i want to choose to get data from folder it works perfectly for all columns except the second which only returns the values of the excel wich i use as sample. I could also upload every day the excel and append the columns with same name and merged the columns with different names into a new column, but what i am looking for is a more automated procedure through power query and not a daily manual append. Does anyone know a way to solve this?

 

3.PNG

2.PNG

1.PNG

  

 

 

 

1 ACCEPTED SOLUTION
T-Pan
Helper I
Helper I

@spinfuzer @m_dekorte , in tranform sample query, i deleted the promote to headers step and add another step of "delete the first row". So now i have column 1, column 2, etc,  as headers and in my appended query  renamed the columns as i want. I don't know if its the right way but it works.

View solution in original post

11 REPLIES 11
T-Pan
Helper I
Helper I

@spinfuzer @m_dekorte , in tranform sample query, i deleted the promote to headers step and add another step of "delete the first row". So now i have column 1, column 2, etc,  as headers and in my appended query  renamed the columns as i want. I don't know if its the right way but it works.

That sounds good.  All you need to do is make sure you have the same column names one way or another.

m_dekorte
Super User
Super User

Alternatively you can transform column names, that will look something like this:

Table.TransformColumnNames( PrevStepName, each if Text.Contains(_, ".") then Text.AfterDelimiter(_, " ") else _)

 

And if as you say it is always the second column, you can easily extract that date and add its value to a new column in the table. That will look something like this.

Table.AddColumn( PrevStepName, "Date", each Text.BeforeDelimiter( Table.ColumnNames(PrevStepName){1}, " ")) 

I do this after i have combined the excels in power query?(get data from folder / combine and tranform) 

No, you would add that to the Transform Sample Query. If you share the code that's in that Transform Sample Query, we can help incorporate that rename step and optionally the add column step as well if desired.

Tomorrow morning will ne the first thing that i will do when i arrived to the office, be sure about that. 😛

spinfuzer
Solution Sage
Solution Sage

Edit the Sample File.

Demote Headers

Extract Text After Delimiter Space on the second column

Promote Headers.  The column name is now just "Missing".

But again its different Column name from the other Excels as you can see from images.  Will ot work?

You need to edit the Transform Sample Query and edit the Main Query because the Main Query might be broken because the column name(s) are different.   You can probably just delete the steps with errors.

spinfuzer_2-1704314284482.png

 

 
 

 

 

 

 

Is Column2 always "Date Missing"?  Date followed by a space then Missing?  If so, yes, it will work.

 

Yes the format o column 2 name is always the same. I've asked the it department to named it "missing" and create another column with "Date". But demands to IT Department always take a lot of time to be made.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.