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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tomand05
Regular Visitor

Dynamic filename in folder and 30000 row limit

Hi!

I got a query that connects to the “newest” *.xlsx file in a folder, that is automatically created every night.
Its easy to filter out the latest file due to the naming. “Excel2023050506 00 36.xlsx” *(yyyymmddhh mm ss).

 

This has worked fine, until the file contained more than 30 000 rows that seems to be the limit, despite its an excel file…

 

Note: If I connect a query to the latest file directly, it works fine, but not when using this dynamic way.

I’m quite new to power query and searching for an answer 🙂

5 REPLIES 5
ajinkyacgaikwad
Advocate I
Advocate I

v-cgao-msft
Community Support
Community Support

Hi @tomand05 ,

I created a test folder with 30,000+ excel files and my steps are as follows for your reference.

vcgaomsft_0-1685078655224.png

 

Get data --> folder --> transform data --> select Name column and right-click --> Sort Descending

vcgaomsft_1-1685078817405.png

Keep the first row;

vcgaomsft_2-1685078914564.png

vcgaomsft_3-1685078943032.png

 

Power bi Desktop [Version: 2.116.622.0 64-bit (April 2023)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi!
It’s not 30 000 files... It’s more than 30 000 rows of data in the excel file .

Payeras_BI
Super User
Super User

Hi @tomand05 ,

How does your query look like? Could you share it?

Do you get an error for that particular file, if so which one?

Regards,

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Hi!
I hoop this is the correct parts of the query 

 

 

Exempelfil meta [IsParameterQuery=true, BinaryIdentifier=Exempelfil, Type="Binary", IsParameterQueryRequired=true]

let
    Källa = Folder.Files("\\aaa\bbb\ccc\ddd\AXIntegration\CSandWHD\Reports"),
    #"Filtrerade rader" = Table.SelectRows(Källa, each not Text.StartsWith([Name], "~")),
    #"Sorterade rader" = Table.Sort(#"Filtrerade rader",{{"Name", Order.Descending}}),
    #"Behåll första rader" = Table.FirstN(#"Sorterade rader",1),
    Navigering1 = #"Behåll första rader"{0}[Content]
in
    Navigering1

let
    Källa = (Parameter1 as binary) => let
        Källa = Excel.Workbook(Parameter1, null, true),
        #"Ax Data_Sheet" = Källa{[Item="Ax Data",Kind="Sheet"]}[Data],
        #"Upphöjda rubriker" = Table.PromoteHeaders(#"Ax Data_Sheet", [PromoteAllScalars=true]),
        #"Ändrad typ" = Table.TransformColumnTypes(#"Upphöjda rubriker",{{"ItemId", Int64.Type}, {"Deleted part", type text}})
    in
        #"Ändrad typ"

 

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.