LOAD *, FileName() AS Source FROM [lib://Data/sales_*.csv] (txt);

Loading many files (wildcards and FileName) in Power BI

Qlik loads every matching file with a wildcard in the FROM path, auto-concatenates them, and FileName() tells you which file each row came from. Power Query's Folder or SharePoint folder connector with Combine files does the same. It adds a Source.Name column, which is the FileName() equivalent. Filter on the file name to get the sales_*.csv pattern.

Direct equivalent Power Query

Short answer: Use Get data > Folder (or SharePoint folder). Filter the Name column with "begins with sales_" and Extension = ".csv", then choose Combine files. Keep Source.Name as the FileName() column.

What it does in Qlik

  • FROM [lib://Data/sales_*.csv] loads every matching file.
  • FileName() returns the current file's name, FileBaseName() the name without extension, and FilePath() the full path.
  • Tables with identical columns are concatenated automatically.

Qlik example

Qlik script
Sales:
LOAD *, FileBaseName() AS SourceFile, Date#(Right(FileBaseName(), 6), 'YYYYMM') AS FileMonth
FROM [lib://Data/sales_*.csv] (txt, utf8, embedded labels, delimiter is ',');

Power BI equivalent

Power Query (what Combine files generates, simplified)

Power Query M
let
    Files   = Folder.Files("C:\Data"),
    Sales   = Table.SelectRows(Files, each Text.StartsWith([Name], "sales_") and [Extension] = ".csv"),
    Parsed  = Table.AddColumn(Sales, "Data", each
                Table.PromoteHeaders(Csv.Document([Content], [Delimiter = ",", Encoding = 65001]))),
    Keep    = Table.SelectColumns(Parsed, {"Name", "Data"}),
    Combined = Table.ExpandTableColumn(Keep, "Data", {"OrderID", "Date", "Amount"}),
    Month   = Table.AddColumn(Combined, "FileMonth", each
                Date.FromText(Text.End(Text.BeforeDelimiter([Name], "."), 6) & "01", [Format = "yyyyMMdd"]), type date)
in
    Month

Gotchas and behaviour differences

  • The expand step lists column names explicitly. A new column in later files is ignored, and a renamed one becomes null. Qlik would create a separate table, or synthetic keys. Check the column list whenever the file layout changes.
  • For SharePoint or OneDrive, use the SharePoint folder connector with the site URL, not Folder.Files on a synced local path. Otherwise scheduled refresh needs a gateway.

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.