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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
NAOS
Advocate III
Advocate III

Expression.Error: The parameter is expected to be of type Text.Type or Binary.Type. on Table.Sort

Hi all,

 

I have a couple of queries that until a few days ago were working and now I found this simple sorting step is causing issues. The error is the following:

Expression.Error: The parameter is expected to be of type Text.Type or Binary.Type.

 

And it occurs when using the function Table.Sort as follows:

 

= Table.Sort(#"Changed Type1",{"Id", Order.Ascending}) 

 

 

If anyone is having or has had a similar issue and have some advice to give me I would much appreciate it.

 

Thanks,

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @NAOS ,

 

After my tests, I cannot reproduce this problem.

What is the data type of "Id"? You could delete this step and sort it again. 

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft,

 

Thanks for your prompt response.
The Id is of type "whole number" - int.64. I tried deleting the steps to fix it and it did not solve the issue.

I also triedreproducing the error myself in other queries and still wouldn't work.

 

It may be worth noting that the two queries were I have problems use the table.buffer function, which is the only thing I can think of is different to most of other queries I've built. 

Here is the code for one of the queries if it helps. The other query is fairly similar and the error occurs on the exact same step.

 

let
    Source = #"Bezirksstruktur IST",
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Index",{"Index", Int64.Type}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Index", Order.Ascending}}),
    BufferedTable = Table.Buffer(#"Sorted Rows"),
    #"Added Custom" = Table.AddColumn(BufferedTable, "RunningCount", (OT) => Table.RowCount(Table.SelectRows(BufferedTable, (IT) => IT[Index] <= OT[Index] and IT[Id] = OT[Id]))),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"RunningCount", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Index"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"RunningCount", "Id"}, "Attribute", "Value"),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Unpivoted Other Columns", {{"RunningCount", type text}}, "en-GB"),{"RunningCount", "Attribute"},Combiner.CombineTextByDelimiter("-", QuoteStyle.None),"Merged"),
    #"Changed Type3" = Table.TransformColumnTypes(#"Merged Columns",{{"Value", type text}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type3", List.Distinct(#"Changed Type3"[Merged]), "Merged", "Value")
in
    #"Pivoted Column"

 

Many thanks for your support.

Hi again,

I found out that the error comes from a column which in turn contained the specified error.

 

Unfortunately I can't explain (because I don't know) what generated it. What's more strange is that once I isolated it by filtering for errors and then refreshed (the preview of) the data (in the query editor), the error banished.

 

If this ever happens to anyone else then I hope the previous steps help you "solve" this.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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