How can I determine the records with the top N values of a column?

时间:2017-06-09 12:37:25

标签: powerquery m

I have a table with a numeric column called "Count" and I want to determine the records with the top 10 values in that column. I tried using List.MaxN([Count],10) but it throws an error:

Expression.Error: We cannot convert the value 0 to type list.
Details:
  Value = 0
  Type = Type

I also tried Table.MaxN(_,[Count],10) and got an error.

What am I doing wrong and how can I get the top 10 values of the column?

1 个答案:

答案 0 :(得分:1)

您需要包含表名,例如

= List.MaxN(MyTable[Count],10)