Page 1 of 1

#47, #49 Using Customer vs. Sales table

Posted: Thu Apr 19, 2018 10:41 am
by trc
My results were the same as the exercises in the book, but I did the CALCULATE over the Sales table and not the Customer table. When would my version 'break'?
e-book: CALCULATE([Total Sales] , All(Customers))
me: CALCULATE([Total Sales],ALL(Sales))

Thanks.

Re: #47, #49 Using Customer vs. Sales table

Posted: Thu Apr 19, 2018 1:34 pm
by RamanaV
If you have a filter applied in your Matrix, say on Occupation (this is called Initial Filter Context), your formula returns same values as that of [Total Sales] by Occupation. The eBook formula, on the other hand, overrides the Initial Filter Context (using ALL over the Customers table), and returns [Total Sales] for all the customers, and you can see the same value displayed for all the rows in the column.

Re: #47, #49 Using Customer vs. Sales table

Posted: Fri Apr 20, 2018 5:40 am
by trc
I think I'm understanding it better.
#1 - I got lucky because the initial filter context happened to be across the Customers table already, with no slicers activated. "Occupation <name> contributed x% to All Sales Made" (my formula) happened to match the answer for "Occupation <name> contributed x% to All Customer Sales" (ebook formula)
#2 - If a Country slicer had been added, Australia for example, my formula would have shown "Australia's Occupation <name> contributed x% to All Sales Made" while the ebook formula would have answered "Occupation <name> contributed x% to Australia's Sales".
my formula - the initial filter context (Occupation, Country) would be active throughout
ebook formula -the Occupation filter would be overridden while Country remains active during the CALCULATE()
#3 - make sure I am answering the correct question!