There's more...

You can also create a down then across measure. This operates the same as AcrossThenDown except that we sum down the first column first and then the first row in the second column gets the total from the first column and so on.

To implement down then across, create the following measure:

DownThenAcross = 
VAR __Table = ALL('R06_Table')
VAR __ColA = MAX('R06_Table'[Col A])
VAR __ColB = MAX('R06_Table'[Col B])
VAR __Count = COUNTX(FILTER(__Table,[Col B] < __ColB),[Col B]) + 1
VAR __PreviousColumns =
SUMX(
FILTER(__Table,[Col B]<__ColB),
[Value]
)
VAR __CurrentColumn =
SUMX(
FILTER(__Table,[Col B]=__ColB && [Col A]<=__ColA),
[Value]
)
RETURN
IF(ISINSCOPE('R06_Table'[Col B]),
IF(__Count = 1,
__CurrentColumn,
__PreviousColumns + __CurrentColumn
),
IF(ISINSCOPE('R06_Table'[Col A]),
SUMX(
FILTER(__Table,[Col A] <= __ColA),
[Value]
),
SUMX(__Table,[Value])
)
)