Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
In the following query, if Folder.Files is changed to Folder.Contents, the following error is reported. What is the cause and what is the remedy?
An error occurred in the ‘Transform File (3)’ query. Expression.Error: The parameter is expected to be of type Text.Type or Binary.Type.
Details:
[Table]
let
Source = Folder.Files("C:\WDS2\Projects\FTP\Production\UHC Work"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File (3)", each #"Transform File (3)"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File (3)"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File (3)", Table.ColumnNames(#"Transform File (3)"(#"Sample File (3)"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"Portal/EDI ID", type text}, {"Customer #", type text}, {"Ship to #", type text}, {"Office #", type text}, {"Invoice Date", type date}, {"Invoice #", type text}, {"Invoice Type", type text}, {"Order Class", type text}, {"Customer PO#", type text}, {"CR Memo #", type text}, {"Billing Model", type text}, {"Patient Name", type text}, {"Patient Mdse", type number}, {"Tax City", type number}, {"Tax Rate Used", type number}, {"Tax County", type number}, {"Tax Other", type number}, {"Tax State", type number}, {"Tax Total", type number}, {"Patient Freight", type number}, {"Addons - Mdse", type any}, {"$Addons - Mdse", type number}, {"Addons - Other", type text}, {"$Addons - Other", type number}, {"Coupon Code", type any}, {"Coupon Discount", type number}, {"Patient Total", type number}, {"Insurance Benefit", type number}, {"CC Type", type text}, {"Patient Payment", type number}, {"Discrepancy", type number}, {"Ship Via", type text}, {"Freight Addon(s)", type text}, {"$Freight Addon(s)", type number}, {"Freight Credits(s)", type text}, {"$Freight Credit(s)", type number}, {"Contract Mdse", type number}, {"Contract Mdse Add", type any}, {"$Contract Mdse Add", type number}, {"Contract Freight", type number}, {"Contract Other", type text}, {"$Contract Other", type number}, {"Prescription Verification", type number}, {"CC Fee", type number}, {"Admin Fee", type number}, {"Contract Tax", type number}, {"Contract Total Due", type number}, {"AvaTax Proc. Fee", type number}, {"Partner Share", type number}, {"Wholesale Tax", type number}, {"Wholesale Mdse", type number}, {"Misc. Income", type number}, {"Due From/(To) Partner", type number}, {"JE SOURCE", type text}, {"1116 Debit", type number}, {"1116 Credit", type number}, {"1400 Debit", type number}, {"1400 Credit", type number}, {"3000 Debit", type number}, {"3000 Credit", type number}, {"4000 Debit", type number}, {"4000 Credit", type number}, {"4120 Debit", type number}, {"4120 Credit", type number}, {"4700 Debit", type number}, {"4700 Credit", type number}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Admin Fee", "AvaTax Proc. Fee", "Tax City", "Tax Rate Used", "Tax County", "Tax Other", "Tax State"})
in
#"Removed Columns"
The error message "Expression.Error: The parameter is expected to be of type Text.Type or Binary.Type" typically occurs in Power BI when there is a mismatch in data types during transformations or when using a function that expects a specific type of input.
Here are a few steps to troubleshoot and fix this issue:
Identify the Source of the Error:
Check Data Types:
Review Applied Steps:
I'm pretty sure the error is with this "Transform File (3)", Table.ColumnNames(#"Transform File (3)"(#"Sample File (3)".
Unfortunately, I'm very new to PQ and I don't have a clue how to fix it.
You would study what Transform File (3) does, and then completely replace with your own code. Keep learning Power Query, it's a useful skill to have.
I would study Transform File (3) if I could find its source and/or documentation. So far that has elueded me.
Go to Power Query, and you find it on the left side in its own group.
The only difference is that Folder.Contents also lists the subfolders (indicated by "Table")
If you filter these out then you should get your expected result.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
15 | |
13 | |
12 | |
11 |