Adding total to graphical table dynamically based on "dummy row"

I have a graphical table based on a data table which has 2 columns inserted into it from two seperate data tables each of which is right joined to the data table used to create the graphical table.   I have a dummy row set up in this datatable which I want to use to create a total for the table using this technique "Case when [BTAs]="Total" then UniqueCount(HinCount12MRCY]) over(All([BTAs])) else UniqueCount([HinCount12MRCY]) end".

I have seen several solutions to this problem such as https://community.tibco.com/questions/does-anyone-know-how-create-custom-expression-specific-row-data-graphic-table.

However, I can't use the types of techniques suggested because of the two created columns.

The problem is that these total needs to be  dynamic based on the user selection for the column.  If one of the two columns for the other table is used then it needs to account for it and not use the overlapping data only when the total is calculated and any the techniques I have seen don't account for the values not being unique to the data table being used.  Any suggestions would be greatly appreciated.

Login