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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Super User
Super User

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Solution Authors
Top Kudoed Authors