I am struggling to get this calculation working in the cube.

Weighted Average Days
Days Value Days * Value
10.8 2000 21600
11.8 1500 17700
12.3 3000 36900

11.7 6500 76200

76200/6500 = 11.7 (Weighted Average)

It works fine as an excel calculation or in an SSRS Report, but I cannot work out how to do it as an MDX formula.

Formula from SSRS
Sum([Measures].[Weighted Average Days]*[Measures].[Invoice Amount])/Sum([Measures].[Invoice Amount])

Any help in resolving this would be appreciated.