Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Get the data from excel when Tab names change dynamically

Hi,

I'm getting data through 'Sharepoint Folder' and would like to get the data from Tab#1 Tab#2 such with this order not with tab name as the names are dynamic over time. 

 

e.g. 2023 will be changing to 2024,,,2025 

Q3 will be changing to Q4,,,and again Q1,,,Q2

 

So hope to get the data with just order like first tab, second tab,,,no matter how the names change. 

Not just for multiple sheets, multiple Tabs from multiple sheets.  

 

 

 


let
Source = SharePoint.Contents("https://nokia.sharepoint.com/sites/korea-pmo-pbi-data-repository", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"KR PO Plan" = #"Shared Documents"{[Name="KR PO Plan"]}[Content],
SKT = #"KR PO Plan"{[Name="SKT"]}[Content],
#"SK_5G Bottom up plan" = SKT{[Name="CT SK_5G Bottom up plan"]}[Content],
#"Filtered Hidden Files1" = Table.SelectRows(#"SK_5G Bottom up plan", 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}, {"Column1", type any}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type any}, {"Column14", type text}, {"Column15", type any}, {"Column16", type any}, {"Column17", type any}, {"Column18", type any}, {"Column19", type any}, {"Column20", type any}, {"Column21", type any}, {"Column22", type any}, {"Column23", type any}, {"Column24", type any}, {"Column25", type any}, {"Column26", type any}, {"Column27", type text}, {"Column28", type text}, {"Column29", type any}, {"Column30", type any}}),
#"Removed Top Rows" = Table.Skip(#"Changed Type",20),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
...

 

 

  • Hi Anonymous 
    Sorry, I don't understand what are tabs, in your picture there are sheets...
    The objects that I am familiar with in Excel are a workbook (the file itself)/ sheets/tables/columns.
    What of those are dynamic in your case?

  • This is exactly the case of the tutorial that I linked...
    Reza shows how to handle the changes on the sheet names level.

  • Anonymous 
    If I understand you correctly and you want the column's names changing automatically I in doubt that it is possible.

    But try to post it as a new question, maybe i am missing something 🙂

10 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, sorry but It's not about my question. 

      Multiple sheets are already applied, I need to apply dynamic Tabs which's name change. 

      • Ritaf1983's avatar
        Ritaf1983
        Super User

        Hi Anonymous 
        Sorry, I don't understand what are tabs, in your picture there are sheets...
        The objects that I am familiar with in Excel are a workbook (the file itself)/ sheets/tables/columns.
        What of those are dynamic in your case?