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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
BennyA
New Member

An error occurred in the ‘FirstQual’ query. Expression.Error

I keep getting an error when I try to run the following code in power query: 

 

The error I am getting is:

An error occurred in the ‘FirstQual’ query. Expression.Error: 8 arguments were passed to a function which expects between 2 and 3.
Details:
Pattern=
Arguments=[List]

 

Can someone help?

 

= () => let
Source = TTQ,
#"ChangedType" =
Table.TransformColumnTypes(Source, {{"EDIPI", Int64.Type}, "TMS", type text}, {"RatingAtCI", type text}, {"PGatCI", type text},
{"AMEXatCI", type text}, {"QualType", type text}, {"QualDate", type text}, {"TTQ_Months", Int64.Type}),
#"Sorted Rows" =
Table.Sort(#"ChangedType", {{"EDIPI", Order.Ascending}, {"TMS", Order.Ascending}, {"QualType", Order.Ascending}, {"QualDate", Order.Ascending}}),
#"Grouped Rows" =
Table.Group(#"Sorted Rows", {"EDIPI", "TMS", "QualType"}, {{"FirstQualDate", each List.Min{[QualDate]},
type date}}),
#"Merged Queries" =
Table.NestedJoin(#"Sorted Rows", #"Grouped Rows", {"EDIPI", "TMS", "QualType", "QualDate"}, {"EDIPI", "TMS", "QualType", "FirstQualDate"},
({"FirstQualType"}),JoinKind.LeftOuter),
#"Removed Columns" =
Table.RemoveColumns(#"Merged Queries", {"FirstQualDate"}),
#"SortedRows1" =
Table.Sort(#"Removed Columns", {{"EDIPI", Order.Ascending}, {"TMS", Order.Ascending},
{"QualType", Order.Ascending}, {"QualDate", Order.Ascending}})

in
#"SortedRows1"

2 REPLIES 2
Anonymous
Not applicable

Hi @BennyA ,

 

The error you are getting is because you have passed too many arguments to the Table.TransformColumnTypes function. This function only accepts two or three arguments: a table, a list of column names and types, and optionally a culture value. You have passed eight arguments, which is invalid.

To fix the error, you need to change the second line of your code to something like this:

#"ChangedType" = Table.TransformColumnTypes(Source, {{"EDIPI", Int64.Type}, {"TMS", type text}, {"RatingAtCI", type text}, {"PGatCI", type text}, {"AMEXatCI", type text}, {"QualType", type text}, {"QualDate", type date}, {"TTQ_Months", Int64.Type}}),

 

Notice that I have changed the type of QualDate column from text to date, since you are using List.Min function on it later. Also, I have removed the extra commas and brackets that were causing syntax errors.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Neeko

 

Thank you for taking the time to respond. I made the changes you suggested and I am now getting the following error:

 

An error occurred in the ‘MinQualDate’ query. Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=[List]
Type=[Type]

Here is the modified code with your changes.  I hope you can spot what I have done wrong.

 

= () => let
Source = TTQ,
#"ChangedType" =
Table.TransformColumnTypes(Source, {{"EDIPI", Int64.Type}, {"TMS", type text}, {"RatingAtCI", type text},
{"PGatCI", type text}, {"AMEXatCI", type text}, {"QualType", type text}, {"QualDate", type date},
{"TTQ_Months", Int64.Type}}),
#"SortedRows" =
Table.Sort(#"ChangedType", {{"EDIPI", Order.Ascending}, {"TMS", Order.Ascending},
{"QualType", Order.Ascending}, {"QualDate", Order.Ascending}}),
#"GroupedRows" =
Table.Group(#"SortedRows", {"EDIPI", "TMS", "QualType"}, {{"FirstQualDate", each
List.Min{[QualDate]}, type date}}),
#"MergedQueries" =
Table.NestedJoin(#"SortedRows", "GroupedRows", {"EDIPI", "TMS", "QualType", "QualDate"}, {"EDIPI",
"TMS", "QualType", "FirstQualDate"}, ({"FirstQualType"}), JoinKind.LeftOuter),
#"RemovedColumns" =
Table.RemoveColumns(#"MergedQueries", {"FirstQualDate"}),
#"SortedRows1" =
Table.Sort(#"RemovedColumns", {{"EDIPI", Order.Ascending}, {"TMS", Order.Ascending}, {"QualType",
Order.Ascending}, {"QualDate", Order.Ascending}})
in
SortedRows1

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.