Forum Discussion
How to edit sheet name in Excel doc when source is a folder
- 4 years ago
Hi, MichaelF1
I probably understand what you mean, but you may need to change your thought and try to use dynamic data sources by using different dates in table names.
You can refer to it first:
Solved: Dynamic Excel name handling in Power BI - Microsoft Power BI Community
Solved: Re: 2 Parameters - Microsoft Power BI Community
Then if you have any specific questions, please feel free to ask me.
Best Regards,
Community Support Team _ JaneyIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi amitchandak , thanks for the reply.
Your video shows how to change the data source if you change the name of the excel file itself, but I want to edit the name of the actual tab in the file. Hope this makes sense, I'll attach the error message.
Thanks again,
Michael
MichaelF1 , Change sheet name in Item
Source = Excel.Workbook(File.Contents("C:\Users\Amit Chandak\Downloads\PivotData (1).xlsx"), null, true),
Pivot_Sheet = Source{[Item="Pivot",Kind="Sheet"]}[Data],
Pivot is my sheet name
- MichaelF14 years ago
Helper III
amitchandak My datasource is a folder, not a single file:
let Source = Folder.Files("C:\Users\.....\PowerBIData\data sources\moves_adjusts"), #"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true), #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File (2)"([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 (2)"(#"Sample File (2)"))), #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"TransactionDate", type date}, {"TransactionTime", type time}, {"TransactionType", type text}, {"Tra Text 1", type any}, {"ItemCode", type text}, {"ProductCode", type text}, {"NumberOf", Int64.Type}, {"LocaCodeFrom", type text}, {"LocGroupCodeFrom", type text}, {"LocaCodeTo", type text}, {"LocGroupCodeTo", type text}, {"Operatorcode", type text}}),- v-janeyg-msft4 years ago
Community Support
Hi, MichaelF1
What do you mean by name of the actual tab?
Not sure what your needs are, Please add more details so we can help you soon.
Best Regards,
Community Support Team _ Janey- MichaelF14 years ago
Helper III
Hi Janey, thanks for getting back to me.
I mean the name of the actual sheet in excel. (see picture)
Thanks again
Michael