The model has sales fact and product dimension. There is M:1 relationship on product_id column.
Assume there is a table visual with 2 columns: Product name and a measure.
Following are 2 sub-questions -
- Question regarding measure 1:
Measure 1 =
CALCULATE(
????????COUNT(Sales[SalesId]),
????????ALL('Product')
????)
Does ALL remove the filter from the product table from the sales table or does ALL return the unfiltered product table that leads to clearing of the filter context? Since table expansion happens only towards the 1 side, then how does un-filtering on product affect the sales calculation? Just trying to visualize the underlying logic of how the un-filtering works.
Question regarding Measure2: Code:
Measure2 = CALCULATE(
????????COUNT(Sales[SalesId]),
????????ALL('Product'[ProductName])
????)
ALL returns a single column (ProductName) table with all filters removed and there is no table expansion happening here so how does it logically work? Again I'm trying to visualize the underlying logic of how the un-filtering works.
question from:https://stackoverflow.com/questions/65862935/how-does-all-tablename-columnname-work-when-used-as-2nd-parameter-of-calculate