SSRS Column chart, total as last column

蓝咒 提交于 2019-12-12 03:56:24

问题


I've got the following column chart: Product names as Category groups with values for budget and revenue on each column. Now I want to create a final column (Total) which is the sum of each column. ie. one column with the total value of the budget and one with the total value of the revenue.

Can this be done directly in the graph without having to do the calculations in the dataset? It's very easy to add a total to a table but seems to be hard to add it to a chart.


回答1:


No, you cannot just add a total column like you can add a total to a table and you are correct that the best approach is to modify your dataset to query.

Either perform a UNION to append a total row or utilize GROUPING SETS (if you want to get fancy) and you should get what you need.

Example UNION:

SELECT product, bedget, revenue
FROM myTable
UNION ALL
SELECT 'total', SUM(budget) as budget, SUM(revenue) as revenue
FROM myTable


来源:https://stackoverflow.com/questions/42527323/ssrs-column-chart-total-as-last-column

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