I have a table that contains data such as:

And I have to create a report table such as:

To display such a report, I use the pivot view from the Interactive Report table. However, my problem is displaying the total columns and the main departments rows(main department1, main department2 …).
Is it possible to display such a report using Oracle Apex?