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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Comparing Group By Aggregation

Hello,

 

I am creating an aggregated table in Power Query using Group By functionality and once I do that I have a column that has an Average Score. When I compare this Avergage Score (it has decimal numbers) to another column that is also of decimal number type, I get an error message.

Expression.Error: We cannot apply operator < to types List and Number.
Details:
Operator=<
Left=[List]
Right=8.13

Does anyone know what mistake am i making or how to fix this?

Thank you

1 ACCEPTED SOLUTION

Hello @Anonymous 

 

exactly, with Def[Target] you are referencing a list. Now depends what kind of calculation you want to apply. Like List.Sum, List.Max etc. you can also referencing the first item by adding {0} after your list reference

 

Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query, or I could create a custom function what makes it easier to apply if you are not used that much to power query.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I realized that my Def[Target] is not a single number but a list of numbers. As soon as I figured out how to resolve that into a single number, the error disappeared.

Hello @Anonymous 

 

exactly, with Def[Target] you are referencing a list. Now depends what kind of calculation you want to apply. Like List.Sum, List.Max etc. you can also referencing the first item by adding {0} after your list reference

 

Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query, or I could create a custom function what makes it easier to apply if you are not used that much to power query.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

AlB
Community Champion
Community Champion

Hi @Anonymous 

The error message is quite clear. You are comparing a list and a number. Show the M code so that we can see where the mistake is.

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

Anonymous
Not applicable

= Table.AddColumn(#"Changed Type", "Indicator", each if [Score] < Def[Target] then "Met" else "Not Met")

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.