Not sure this is possible but I hope someone will prove me wrong …
Let’s say we created a measure like this:
Closing Balance =
VAR LastDates =
CALCULATETABLE( VALUES( 'Date'[Year] ), ALLSELECTED( 'Date'[Date] )),
"@MaxDate", CALCULATE( MAX( Funding[Date] ), VALUES( Funding[Date] ))
), "LastDates", [@MaxDate]
IF( ISINSCOPE( 'Date'[MonthName] ),
SUM( Funding[Closing Balance] ),
CALCULATE( SUM( Funding[Closing Balance] ), FILTER( ALL( 'Date'[Date] ), 'Date'[Date] IN LastDates ))
When drilled up the result is as below, looking good - right
But when you drill back down again you get the same Total and that’s because you can’t actually perform a test to see if Months are being displayed in a visual or not (as far as I know at this time) and that “Month” context is missing in the Total field.
So I think your only alternative is to layer the visuals and switch between them (show/hide) using buttons.