SSRS sum max by group

妖精的绣舞 提交于 2019-12-01 03:53:44

In both of the total textboxes, region and Grand Total, you can use the same expression:

=Sum(max(Fields!goal.Value, "LocationName"))

Because the expression is calculated in the current Scope of the textbox, at the Region Group level this will be aggregating the Max goal value in all LocationName groups in the region, and at the Grand Total level this will be aggregating the Max goal value in all LocationName groups in all regions.

You can see this in action. With data like:

(I've doubled up the rows to make it obvious if the end totals are correct)

and a simple table:

The same expression gives the correct result in both the Region and Grand Total Scope:

Have you tried =Max(Fields!goal.Value) ? If you need the unscoped grand total this should work. Here is a great MSDN article on Adding Grouping and Totals. Below is an image taken from that article that shows how to set it up.

Renders:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!