First of all, such formatting and presentation kind of stuff is not a matter of a query. A query gives you the data, the rest is up to a presentation layer (whatever kind of). So it is a bad design decision to take this path. If this is meant to be a serious BI application, you will encounter maintainability issues during it's life-cycle.
Wither way, if you stick to this approach, will have to add an UNION at the end which will need to have the same underlying query, but without a GROUP BY.
I have not tried to recreate your data, so check this explanatory example:
create table data(D char(1), A int);
insert into data values('A', 10);
insert into data values('A', 20);
insert into data values('B', 30);
insert into data values('B', 40);
select D, sum(A) from data group by D union select 'T', sum(A) from data;
That will look ugly in your case.
But you can use a view or
CTE[
^] to make it a little bit nicer:
with myCTE (myD, myA)
as (
select D as myD, A as myA from data
)
select myD, sum(myA) from myCTE group by myD union select 'T', sum(myA) from myCTE;
And you can put all your calculation inside the
AS(...)
part, so you don't have to repeat it after the UNION clause.