<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Import multiple tables from excel file in dataflow gen 2 in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341258#M5748</link>
    <description>&lt;P&gt;Look at the Advanced Editor code - you will see the individual navigation steps.&amp;nbsp; Remove the step that chooses a sheet.&amp;nbsp; Then add a filter to select the desired sheets (the ones starting with "tbl_"&amp;nbsp; (which is an unfortunate name for a sheet, btw) and then create your own ingestion routine that you can apply to each of them. Finally combine the resulting tables.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2024 01:12:50 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-12-24T01:12:50Z</dc:date>
    <item>
      <title>Import multiple tables from excel file in dataflow gen 2</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4340873#M5744</link>
      <description>&lt;P&gt;Hi all, I have an excel file that is stored in a Sharepoint folder. I am trying to ingest all tables within this file that start with 'tbl_' into a lakehouse. I tried to do this with the Dataflow Gen 2 &amp;amp; Sharepoint folder connector, however, I am only able to select one of these tables at the time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jesse_oudshoorn_0-1734962134483.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1218881iA91C840EDCCC1516/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jesse_oudshoorn_0-1734962134483.png" alt="Jesse_oudshoorn_0-1734962134483.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There will be more tables added into this file that start with 'tbl_' in the future and I would like to run a daily refresh on this dataflow as to get all these tables updated everyday.&amp;nbsp;Is there a possibility to ingest all tables that start with 'tbl_' dynamically into the lakehouse via this way? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 14:00:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4340873#M5744</guid>
      <dc:creator>Jesse_oudshoorn</dc:creator>
      <dc:date>2024-12-23T14:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple tables from excel file in dataflow gen 2</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341258#M5748</link>
      <description>&lt;P&gt;Look at the Advanced Editor code - you will see the individual navigation steps.&amp;nbsp; Remove the step that chooses a sheet.&amp;nbsp; Then add a filter to select the desired sheets (the ones starting with "tbl_"&amp;nbsp; (which is an unfortunate name for a sheet, btw) and then create your own ingestion routine that you can apply to each of them. Finally combine the resulting tables.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 01:12:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341258#M5748</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-24T01:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple tables from excel file in dataflow gen 2</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341479#M5751</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/704256"&gt;@Jesse_oudshoorn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from lbendlin&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand your need now, currently it is not possible to use Dataflow Gen2 refresh to write different tbl_ tables to lakehouse, more steps need to be done manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the test I did, I stored the excel file named summarizeTable in SharePoint with 5 tables starting with tbl_.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_0-1735012927165.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219076i01B88E0FB334E9EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_0-1735012927165.png" alt="vhuijieymsft_0-1735012927165.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't select the combine option, which will put us in a situation where we can only select one table, just click create.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_1-1735012927169.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219075iDA69EF6E7FDC9BA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_1-1735012927169.png" alt="vhuijieymsft_1-1735012927169.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see that the binary file inside content contains five tables.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_2-1735012941911.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219079i2F6E24259D913C31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_2-1735012941911.png" alt="vhuijieymsft_2-1735012941911.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_0-1735013007175.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219080iA2D216D4ADBC59A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_0-1735013007175.png" alt="vhuijieymsft_0-1735013007175.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Click on Advanced Editor and enter the code below, this will show you the table name and the corresponding table.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_4-1735012941916.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219078iD97B37F886617352/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_4-1735012941916.png" alt="vhuijieymsft_4-1735012941916.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = SharePoint.Files("your_sharepoint_site", [ApiVersion = 15]),
    ExcelFile = Source{[Name="your_table.xlsx"]}[Content],
    ExcelTables = Excel.Workbook(ExcelFile),
    FilteredTables = Table.SelectRows(ExcelTables, each Text.StartsWith([Name], "tbl_")),
    TableNames = Table.Column(FilteredTables, "Name"),

    // Define a function to process each table
    ProcessTable = (tableName as text) as table =&amp;gt;
        let
            TableData = Table.SelectRows(ExcelTables, each [Name] = tableName){0}[Data],
            PromotedHeaders = Table.PromoteHeaders(TableData, [PromoteAllScalars=true])
        in
            PromotedHeaders,

    // Iterate through each table to generate separate table objects
    Result = List.Transform(TableNames, each [Name = _, Data = ProcessTable(_)]),
    ExpandedResult = Table.FromRecords(Result)
in
    ExpandedResult&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use a single table, you can click [Table] and add it as a new query.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_1-1735013025934.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219082i7ECE93B1BCAC263D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_1-1735013025934.png" alt="vhuijieymsft_1-1735013025934.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember to rename the query and this is what the data will look like on display. Now you can set the destination to load it into lakehouse.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_2-1735013025938.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219081iF09004A155019E02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_2-1735013025938.png" alt="vhuijieymsft_2-1735013025938.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a workaround, and I understand it's a pain in the ass, but there's currently no automated process in dataflow gen2 that I'm aware of that automatically loads tables from different Queries into lakehouse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to write it all at once you can use this code in the advanced editor, but this is less intuitive and I don't think it's as good as the first method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = SharePoint.Files("your_sharepoint_site", [ApiVersion = 15]),
    ExcelFile = Source{[Name="your_table.xlsx"]}[Content],
    ExcelTables = Excel.Workbook(ExcelFile),
    FilteredTables = Table.SelectRows(ExcelTables, each Text.StartsWith([Name], "tbl_")),
    ExpandedTables = Table.ExpandTableColumn(FilteredTables, "Data", Table.ColumnNames(FilteredTables{0}[Data])),
  #"Removed columns" = Table.RemoveColumns(ExpandedTables, {"Name", "Item", "Kind", "Hidden"}),
  #"Promoted headers" = Table.PromoteHeaders(#"Removed columns", [PromoteAllScalars = true]),
  #"Changed column type" = Table.TransformColumnTypes(#"Promoted headers", {{"ProductName", type text}})
in
    #"Changed column type"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_3-1735013139575.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1219083i4AD773F8F0C4C902/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_3-1735013139575.png" alt="vhuijieymsft_3-1735013139575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 04:07:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341479#M5751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-24T04:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple tables from excel file in dataflow gen 2</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341815#M5755</link>
      <description>&lt;P&gt;Thanks! This works like a charm. I went with the first solution you provided and it gives me what I need!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 07:39:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Import-multiple-tables-from-excel-file-in-dataflow-gen-2/m-p/4341815#M5755</guid>
      <dc:creator>Jesse_oudshoorn</dc:creator>
      <dc:date>2024-12-24T07:39:15Z</dc:date>
    </item>
  </channel>
</rss>

