Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
Solved! Go to 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
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
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
= Table.AddColumn(#"Changed Type", "Indicator", each if [Score] < Def[Target] then "Met" else "Not Met")
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 6 | |
| 5 |