Last answered:

25 Apr 2020

Posted on:

24 Apr 2020

0

POWER BI TASK 4

%TotalAmountSales = DIVIDE([TotalSalesAmount], CALCULATE(SUm(fact_InternetSales[SalesAmount]),ALL(dim_SalesTeritory[SalesTerritoryCountry]),ALL(dim_SalesTeritory[CountryOrder])))   %SalesUnitedstates = DIVIDE([SalesAmountUnitedStates], CALCULATE(SUM(fact_InternetSales[SalesAmount]),ALL(dim_SalesTeritory[SalesTerritoryCountry]))) Why did we use CALCULATE in both of these DAX equations wherein why can't we choose the denominator as TotalSales ?
1 answers ( 0 marked as helpful)
Instructor
Posted on:

25 Apr 2020

0
Hey Venkat, Because we need to remove specific filters from our calculation, otherwise we will not get the correct numbers. Imagine this, the SUM of SalesAmount would SUM the whole column, but when it needs to divide against itself it would return 1. Because DAX calculates row by row. So we want column A1 to divide against the sum of A1 to A20. That's why we need to apply ALL function to the denominator. We cannot use ALL on its own with SUM so we use CALCULATE. I hope this makes sense.

Submit an answer