Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm trying to compare relative sales, but total sales doesn't seem to ignore any selections.
Sum(Aggr(Sales, Product, Country))
/
Sum({1} TOTAL Aggr(Sales, Product, Country))
Working from the inside out in the bottom "total" expression, you start with aggr(Sales, Product, Country). Sales here is interpreted as only(Sales), which is an aggregation expression, one to which you've applied no set analysis at all, and so the selections affect it. So at a minimum, change that part to aggr(only({1} Sales), Product, Country), though you may want to instead aggr(sum({1} Sales), Product, Country).
Assuming this is a chart with Product and Country as dimensions, though, perhaps simplify to something like this. I'm not sure why you're doing an aggr(). Pivot table, maybe?
sum(Sales)/sum({1} total Sales)
Try
Sum( Total <Sales, Product, Country> Sales )