I have a calculated member that doesn't add up to the total line in the pivot table.
I will try to explain with the sample pivot table below
![]()
CREATE MEMBER CURRENTCUBE.[Measures].[total client cost]
AS
sum(Descendants([Version].[Version Hierarchy].CurrentMember,
[Version].[Version Hierarchy].[Month]),
[Measures].[Total Client items] * [Measures].[Cost Per Item]),
FORMAT_STRING = "$#,##0;($#,##0)";
The issue is if you add up column I for total client cost (rows 22 - 28)
$128,476 |
$0 |
$565,182 |
$1,097,124 |
$2,048,151 |
$6,083,148 |
$0 |
You get $9,922,080 but the total total client cost is showing $8,959,816 (I31)
This is because the user requested that at the quarter level we add the previous 3 months totals
so for qtr1 we have $2,597,824 which is the sum of Jan $840,522 (B31), Feb $891,967 (C31) and Mar $865,335 (D31)
so at the year level or budget total it adds the previous 4 quarters (qtr1, qtr2, qtr3, qtr4) for the corresponding row which is correct.
Even at the total level for the measure "Total client cost" for Jan we have $840,522 (B31) it doesn't add up to the column
total client cost |
Region 1 | $6,793 |
Region 2 | $0 |
Region 3 | $53,232 |
Region 4 | $92,189 |
Region 5 | $228,687 |
Region 6 | $533,428 |
Other | $0 |
= $914,329
In this case above is taking 2085 * 403.1281 (pivot displays 403.13 as it rounds)= $840,522 but I would like to have it do the sum of total client cost to get $914,329.
The totals lines on the right do sum the parts to the left and get correct values.
for example total client cost
Region 1 total = $128,476 which adds qtr1 $26,412 (E22), qtr2 $30,617 (F22), qtr3 $35,617 (G22), qtr4 $35,829 (H22)
I would like to change the way the pivot is adding up the columns not the rows as the row totals are ok and correct for us. Is the column totals, so column B-I for row 31.
Is there an MDX script that can accomplish this? But the dimensions could be others so I don't want to hard code the regions. I want to treat the totals lines different by adding the parts above it.