Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to build 2 gauge charts.
Having the dimensions City , Country and Sales, I want the first one to calculate the % of the sales for a selected City, the second one to calculate the % of sales for a selected country.
So, I used the expressions:
Sum([Sales])/Sum(TOTAL {<City>} [Sales])
Sum([Sales])/Sum(TOTAL {<Country>} [Sales])
Let's consider for example the city Berlin in Germany.
Total sales in Berlin = 3 690 826 --> 6.7% of the total
Total sales in Germany = 5 761 092 --> 10.4 % of the total
Total sales Worldwide = 55 184 241
Now, if I filter Berlin, I get 100% in the second chart (for %of countries), but I would like to get 64% which is the %of sales in Germany for the city Berlin, meaning that instead of taking into account all the countries, I want to consider only possible countries based on the selection of the city.
Can you help me ?
Thank you 🙂
May be try this
Sum([Sales])/Sum(TOTAL {<Country = p(Country), City>} [Sales])
May be try this
Sum([Sales])/Sum(TOTAL {<Country = p(Country), City>} [Sales])
Hello,
it works fine !
It's still not clear to me how P and E work, but will try to find more guidelines to understand them 🙂
Thank you very much,
have a nice weekend
May be look here to see what p() and e() does