SSRS totaling in groupings

Christopher Jack 1,611 Reputation points
2021-10-28T14:35:43.147+00:00

Hi,

I am trying to total a column in a grouping in SSRS but it seems to be totaling based on other columns.

See below

144545-screenshot-2021-10-28-153158.png

Any help appreciated.

I have tried =Sum(Max(Fields!Backorders.Value, "SKU")) but I get the error

Scope not valued for nested argument.

The normal Sum does not work either.

See below for groupings.

144578-capture.jpg

144558-capture.jpg

Thanks

Any help appreciated

Chris

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,797 questions
{count} votes

Accepted answer
  1. Joyzhao-MSFT 15,566 Reputation points
    2021-10-29T02:31:54.003+00:00

    Hi @Christopher Jack ,
    I'm not sure if you just want to get these Total values, because during my test, I selected [Landed Cost]——Insert Row——Inside Group-Below, and then used it in the newly created row: =Sum(Fieilds !FieldName.Value) can get the total of each column.
    Taking [Retail Rice] as an example, there are a total of 8 rows of data in its detail row, which are four rows of value "60" and four rows of value "100", so the expression =Sum(Fieilds!FieldName.Value) is used when we calculating the value of eight rows.

    144782-01.jpg

    If you want to get the total in the figure below, you can also select [Landed Cost]——Insert Row——Inside Group-Below to create a new group inside row.

    144793-02.jpg

    Then use the following expression,please refer to the following images:

    144738-03.jpg
    144816-04.jpg
    144804-05.jpg

    Hope this helps!
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 47,806 Reputation points
    2021-10-28T15:02:30.34+00:00

    At just a quick glance I'd say you shouldn't be using MAX. Max will give you the maximum value of the given field but you want the sum, not the max value. Without knowing more about your dataset then try this =Sum(Fields!Backorders.Value, "SKU"). That should sum the Backorders fields given the SKU scope. Are you using scopes? If you put this expression inside the group itself then you shouldn't need a scope IIRC. =Sum(Fields!Backorders.Values)

    Refer to the documentation for more help on grouping totals.