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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
List.Average is not computed correctly in this code.
[
Source = #table({"Value"}, {{null}, {1}}) & #table({"Value"}, {{2}}),
Avg = List.Average(Source[Value])
]
It computes to 1 whereas it should be 1.5. Such incorrect List.Average calculation seems to occur anytime you are working with a non-buffered table built by combining tables. If you do an average on a column from a table like the code above or in a Table.Group, the average calculation erroneously includes nulls in the value count for the denominator. The error does not occur with List.NonNullCount, List.Median, or List.StandardDeviation. Also, if you buffer the table or buffer the list before averaging, the error does not occur.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.