I have a simple data model with two dimensions and a fact table. The dimensions are called BondDim and AccountDim. They slice the fact table. The BondDim and AccountDim join to the fact table in a one-to-many relationship. I would like to create the measure "BondAmt" as shown here in bold outline:
I have tried this measure, but it seems to cross-join Bond and Account, and blows up the pivot table with a lot of blank rows:
=calculate([Amt], ALL(AccountDim), BondDim[Bond] = BondDim[Bond] )
How can I calculate the BondAmt totals column and have it be correct in whatever Bond and Account filter context I have?
EDIT:
As suggested by @sergiom, using
BondAmt = CALCULATE(SUM(Fact[Amt]), ALL(AccountDim))
returns the following:
It returns all of the accounts regardless of whether the Account owns the Bond (Bond #1 shown in the picture). How can I return only those accounts that have Amt in the bond?