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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

The mess "Expression.Error: The 'Count' argument is out of range" appears when I tried to group rows

The message: "Expression.Error: The 'Count' argument is out of range" appears when I tried to group Rows.

I need to group by the name of the project and its description, and create a new column with the sum of all the money for this project, because I have a row with each month, and I need the sum of this value.

 

I tried to change the type of the row to: decimal number, fixed decimal number, and whole number, that have the money, but it continue falling.

 

The problem is that the message appeared and I can´t grouped it.

 

Thanks a lot of your help.

 

Best regards,

Mayte

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks @MarcelBeug for your answer,

 

I changed totaly my query and I fixed it.

 

Best regards,

Mayte

View solution in original post

7 REPLIES 7
HM_
New Member

I face the same problem.

It took me hours to resolve it and realize it's my data problem.

There is an empty line thus I believe you may be able to insert a rule to filter out empty line.

Anonymous
Not applicable

The message: "Expression.Error: The 'Count' argument is out of range" appears when I tried to group Rows.

I need to group by the name of the project and its description, and create a new column with the sum of all the money for this project, because I have a row with each month, and I need the sum of this value.

 

I tried to change the type of the row to: decimal number, fixed decimal number, and whole number, that have the money, but it continue falling.

 

The problem is that the message appeared and I can´t grouped it.

 

Thanks a lot of your help.

 

Best regards,

Mayte

 

 

Hi @Anonymous,

Have you resolved your issue? If you have, please mark the right reply as answer.

Best Regards,
Angelia

Anonymous
Not applicable

Hi @v-huizhn-msft,

 

My formula is the next:

= Table.Group(#"Removed Columns1", {"ID"}, {{"Total", each List.Sum([Original Estimate]), type number}})

 

I tried tu sum the "Original Estimate" value of each project and it fail.

 

Best regards,

Mayte

The code looks fine to me, so I guess something is wrong with your data.

It is possible that the error occurred in a previous step and not with Table.Group, so please double check on that,

 

Just to illustrate that the code works fine, below a query you can copy/paste in a new query in the advanced editor.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0UIrViVYyAjLhDFMwyxgmZILKiAUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, #"Original Estimate" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Original Estimate", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Total", each List.Sum([Original Estimate]), type number}})
in
    #"Grouped Rows"
Specializing in Power Query Formula Language (M)
Anonymous
Not applicable

Thanks @MarcelBeug for your answer,

 

I changed totaly my query and I fixed it.

 

Best regards,

Mayte

Hi @Anonymous,

Could you please share your formula to check where the problem came from? So that we can post the solution which is close to you requirement.

For my sample table, you can use ALLEXCEPT to filter like the formula: 

Column = CALCULATE(SUM(Table7[sales]),ALLEXCEPT(Table7,Table7[projects]))


You will see the result in the following screenshot, it calculate sum(sales) group by project.

1.PNG

Please review the count function, and the examples in the site.

Best Regards,
Angelia

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.