Reputation: 9684
Instead of the above, can we write:
US Sales = CALCULATE(SUM(FactInternetSales[SalesAmount]),ALL(DimSalesTerritory)
,DimSalesTerritory[SalesTerritoryCountry]="United States"
)
Upvotes: 0
Views: 86
Reputation: 4005
Another one of your questions that can be answered with more or less the same answer: Syntax sugar! Your two queries are identical under the hood.
Also note the difference between the below:
US Sales =
CALCULATE (
SUM ( FactInternetSales[SalesAmount] ) ,
DimSalesTerritory[SalesTerritoryCountry] = "United States"
)
which is syntax sugar for:
US Sales =
CALCULATE (
SUM ( FactInternetSales[SalesAmount] ) ,
FILTER (
ALL ( DimSalesTerritory[SalesTerritoryCountry] ),
DimSalesTerritory[SalesTerritoryCountry] = "United States"
)
)
But note that the ALL
clause evaluates the single column and not the whole DimSalesTerritory
table. Filter context on the other columns in that table are preserved.
Upvotes: 1