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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

folder load where to change the file name ?

Hi All

I am using folder load , in the folder have only one file , i try to change the file name , in M code where can i modify the file name ?

Paulyeo11_0-1604452737277.png

 

1 ACCEPTED SOLUTION

@Anonymous ,

 

You can find it in View Tab

1.png

View solution in original post

19 REPLIES 19
AllisonKennedy
Super User
Super User

@Anonymous please can you copy and paste the M code, not just photo, then we can help better. The image is too small to see the detail.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi Allison

Thank you for wanted to help.  But This post is kind of a bit confuse now. Let me start a new post. As i not sure you refer to what ?

Paul Yeo

PhilipTreacy
Super User
Super User

Hi @Anonymous 

The idea with Get Data -> Folder is that you don't have to specify file names.  It just gets the files in that folder.  Why do you want to change the file name?  If the folder only has 1 file in it, and you have replaced the 'old' file with a 'new' one, PQ should still get the data from the 'new' file provided the file structure is the same.

The Get Data -> Folder connector expects all files in that folder to have the same structure.

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Phil

The reasons i need to change the file name , is beause for testing purpose i want to test with less data , for example i just load 10 row of data , and when it work , i load full data , and when got problem , i can switch to sample file.

may be you can share with me how to load by folder only load 10 row of data ?

Paul

 

Hi @Anonymous 

OK, if you want to do it that way, have both your test and live data files with the same name.  Obviously they need to be stored in separate folders.

When you are testing move the test file into the folder you are loading from.  When you go live, move the test file out and the live file in to the folder.

That way you don't need to change the query at all.

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Sir

I just try to save the test file and actual in diff folder , and when i reload actual folder , no issue , and when i change to test folder , i get below error , where go wrong ?

Paulyeo11_0-1604461089559.png

error msg below :-

Paulyeo11_1-1604461181380.png

 

 

 

Hi @Anonymous 

I didn't say to change folders, that's what we want to avoid.

I said create 2 files with the same name, one for test data and the other for your real data.

Set up your query to load data from a folder with your test file in it.

When you are happy things are working, move the test file out of that folder and put your real data file in it.

Because the files have the same name (and structure) PBI will not know the difference between the files.  They look exactly the same, just that one has real data in it.

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Phil

i think i heard you said this , i dont change folder , but create 2 folder , one is for test , another one is actual data , both file name the same . but the sample file only few row of data , and after testing successful , then i stop loading into PQ. 

it is what you mean ?

Paul

Hi @Anonymous 

No,

 

1. create only 1 folder

2. Create 2 files, both have the same name. 

3. Put 1 file (the test file) into the folder you created in Step 1.  Store the other file (the live data) somewhere else.

4. Set up your query to load from the folder from Step 1

5. When you are happy with your testing, remove the test file from the folder.

6. Put the live data file into the folder.

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Phil

I try to create 2 file with same file name , it is not allow , so i create 2 file with diff file name , and now i don't know what i should do ?

Paulyeo11_0-1604467885955.png

 

@Anonymous 

 

You can change the Sample file if that is what you want to achieve.

{0} - you can see like this on the sample M query, it represents the row no of the file that is being taken as a sample.

But please note that all your steps will be applied to all files inside the folder.

 

Hope this helps.

 

 

Anonymous
Not applicable

Hi Sir

I just load a sample file , below is the script , may i know where i can change the number of row to load ?

 

let
Source = Folder.Files("C:\Users\pauly\OneDrive - ISDN Holdings Limited\PBI FOLDER\SI_ISDN_TEST"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"Customer/Vendor", type text}, {"Customer Name", type text}, {"Payment Terms", type text}, {"AR Invoice Number", type date}, {"AR Invoice Date", type text}, {"Month", type text}, {"Item No.", type any}, {"Item/Service Description", type text}, {"Quantity", Int64.Type}, {"Currency Rate", type number}, {"Price Currency", type text}, {"Price", type number}, {"Row Total (FC)", type number}, {"Row Total (SGD)", type number}, {"Row Total w/ VAT", type number}, {"ItemCost (SGD)", Int64.Type}, {"Total Item Cost Value (SGD)", Int64.Type}, {"Item Group", type any}, {"Product Code", type any}, {"Product Class", type any}, {"Manufacturer (Brand)", type any}, {"SlpName", type text}, {"Industry Description", type text}, {"Sub-Industry", type text}, {"Bill To Country Code", type any}, {"Ship To Country Code", type any}, {"Foreign Name", type any}})
in
#"Changed Type"

 

Paul

 

@Anonymous ,

 

you must go to the Sample File and check the formula bar

 

test.png

Anonymous
Not applicable

Hi Sir

Thank you for sharing. i just create the new file load from folder , i cannot locate the formla bar :-

Paulyeo11_0-1604465234677.png

 

You can enable it.

View->tick formula bar

Anonymous
Not applicable

Hi Muss

Can you pls share the screen shot how you can enable it ? i still cannot find it.

Paulyeo11_0-1604467066517.png

 

@Anonymous ,

 

You can find it in View Tab

1.png

Anonymous
Not applicable

Hi Sir

Today i learn few more new thing , thank you very much , so next step is can you share where i can set to load how many row of data ?

amitchandak
Super User
Super User

@Anonymous , Nor very sure, but it will tread it as a new file in the folder

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors