Forum Discussion
Issues with Grand Total Calculation from Measure
Hi czzlglg ,
Please refers to the following steps.
Create a measure to store "FeeIncome".
FeeIncome =
VAR VolumeLastYear =
CALCULATE(
SUM('table'[volume]),
PARALLELPERIOD(DateTable[Date], -12, MONTH)
)
VAR SelectedCountryCode =
MAX('table'[country_code])
VAR SelectedBusinessProduct =
MAX('table'[business product])
VAR FeeRate =
SWITCH(
TRUE(),
SelectedBusinessProduct = "I" && SelectedCountryCode IN {"AT", "CH", "BE", "FR", "NL"}, 0.09,
SelectedBusinessProduct = "I" && SelectedCountryCode = "DE", 0.07,
SelectedBusinessProduct = "O", 0.1,
SelectedBusinessProduct = "A", 0.09,
SelectedBusinessProduct = "IC", 0.09,
0.0 -- Default if none of the conditions match
)
VAR FeeIncome =
IF(
NOT ISBLANK(VolumeLastYear),
VolumeLastYear * FeeRate,
0
)
RETURN
FeeIncome
Then, reference the [FeeIncome] measure in the [Fee Income M-12 Intraday (EUR) TradeDate] measure.
Fee Income M-12 Intraday (EUR) TradeDate =
SUMX(
VALUES('table'[country_code]),
[FeeIncome]
) / 100
The final result is as follows. The total value is equal to the sum of the values in each row.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous,
Thank you for your solution and the time you invested in it.
However, I’ve encountered an issue. Your solution works perfectly when filtering for a single business product, but the grand total remains incorrect when no filters are applied. My table needs to display all products together, not individually.
Could you please assist with this scenario? I’ve been struggling with this for almost a week and haven’t found a solution yet.
Thanks!