6 Replies Latest reply: Nov 3, 2017 10:27 AM by William Fu

# Weighted average measure not changing based on dimension

I have this weighted average formula, and it gives me the same values for whichever dimension I pivot it by:

Sum({\$<[LLR.PdCorrente]-={100}>} Total [LLR.PdCorrente] * Aggr (Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente])) / Sum({\$<[LLR.PdCorrente]-={100}>} Total Aggr(Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente]))

However if I select a specific member of a dimension, it calculates correctly.

Any ideas?

• ###### Re: Weighted average measure not changing based on dimension

Is this saved in a variable? If it is, then you might have used an equal sign when you save the variable definition.... try to get rid of the equal sign and see if that helps..... (all hypothetical, but I think that might be the issue)

• ###### Re: Weighted average measure not changing based on dimension

It is saved as a variable, but there's no equal sign preceding it.

• ###### Re: Weighted average measure not changing based on dimension

May be try to remove these TOTAL key word from here

Sum({\$<[LLR.PdCorrente]-={100}>} Total [LLR.PdCorrente] * Aggr (Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente])) / Sum({\$<[LLR.PdCorrente]-={100}>} Total Aggr(Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente]))

And try this:

Sum({\$<[LLR.PdCorrente]-={100}>} [LLR.PdCorrente] * Aggr (Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente])) / Sum({\$<[LLR.PdCorrente]-={100}>} Aggr(Sum({\$<[LLR.PdCorrente]-={100}>} Saldo), [LLR.PdCorrente]))

• ###### Re: Weighted average measure not changing based on dimension

Hi Sunny,

I tried your suggestion and got an even stranger behavior (see WeightedAvg_v1). The static measure I originally mentioned can be seen in WeightedAvg_v2.

However if you click a certain month in the dimension, the text box measures calculate as expected (7.33 for July/2017), despite the strange chart behavior:

• ###### Re: Weighted average measure not changing based on dimension

Would you be able to share a sample?

• ###### Re: Weighted average measure not changing based on dimension

Hi Sunny,

This simpler measure is working just fine; apparently there was no need for Aggr/Total

Sum({\$<[LLR.PdCorrente]-={100}>} [LLR.PdCorrente] *  Saldo)

/

Sum({\$<[LLR.PdCorrente]-={100}>} Saldo)