powerbidaxdata-analysispowerbi-desktopmeasure

How does ALL return distinct rather than all values in FILTER DAX (versus VALUES)?


Calculate Inbound = 
CALCULATE( [Total Cost] , 
    FILTER( ALL( Sheet1[Type] ) ,
        Sheet1[Type] = "Inbound Shipping" ) )

The ALL in above filter seems to return distinct list of Type.

My understanding was that VALUES returns the distinct values?


Solution

  • They both return distinct values. DAX effectively always works with the distinct values in a column (the cardinality of the column or number of distinct values is one of the most important factors in Power BI). The difference is that VALUES returns the values visible in the evaluation context whilst ALL ignores the evaluation context and gets all the values.