How to get separate totals on an SSRS report based on values in rows?

rwheeler23 used Ask the Experts™
I have a SQL 2017 SSRS report that is grouped by state by month. There are two lines per state with the 12 months spread across each line. The first line is total invoice amount and the second line is total sales tax amount. I am now trying to configure the footer to show the total for all states with one being the total for the sales amount and the other being the total for the sales tax amounts. I do have a column called Type where Sales = sales amount and Tax = sales tax amount. I tried creating two groups at the bottom based on Type with filters but both lines keep giving me to total of both. Underneath this report is a SQL query with a union between the sales amounts and the sales tax amounts. How should I structure the totals to present the two separate totals?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Technical Director
Have two variables total_sales_amount and total_tax_amount and initialise them to 0 in report header section
in footer of state , total_sales_amount=total_sales_amount + sales
total_tax_amount=total_tax_amount + tax

Then in report footer just print total_sales_amount and total_tax_amount


Thanks for tip. It worked.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial