Resolved: Doubt on DAX formula
Why can't we use directly,
%SalesUnitedStates = DIVIDE([SalesAmountUnitedStates], [TotalSalesAmount], ALL(dim_SalesTeritory[SalesTerritoryCountry]))*100
As we already have calculated the [TotalSalesAmount].
But I am getting ths error as shown in Attched file.
Because the syntax is incorrect, the DIVIDE function is a asking for a nominator, denominator and an alternative result which is optional. The SalesTerritoryCountry is a text field therefore it cannot be an alternative result. We are including it inside the CALCULATE function, so that we are dividing the sales of the United States against the Total Sales Amount for ALL countries. Please use the code shown inside the video.