hi,
can anyone point me in the direction of how DAX calculates, for example
I have the following measure ;
straight forward sum,
which I can then use ;
RTSALES:=VAR mdate = MAX(pTaverage[date])
VAR anser =
CALCULATE(SUMX(FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdate ) , [Pa salestotal]) )
RETURN anser
but if I replace the measure at the end with ;
VAR mdate = MAX(pTaverage[date])
VAR anser =
CALCULATE(SUMX(FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdate ) , SUM(pTaverage[units]) )
RETURN anser
it doen't work, I have tried wrapping in CALC, as measure have an implicit calculate but no good. but course if i placed the sum after Calculate and
then did the filtering it would.
CALCULATE(SUM(pTaverage[units]) ,FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdatee ) )
can anyone point me in the direction of how DAX calculates, for example
I have the following measure ;
Excel Formula:
Pa salestotal:=SUM(pTaverage[units])
which I can then use ;
RTSALES:=VAR mdate = MAX(pTaverage[date])
VAR anser =
CALCULATE(SUMX(FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdate ) , [Pa salestotal]) )
RETURN anser
Excel Formula:
but if I replace the measure at the end with ;
VAR mdate = MAX(pTaverage[date])
VAR anser =
CALCULATE(SUMX(FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdate ) , SUM(pTaverage[units]) )
RETURN anser
it doen't work, I have tried wrapping in CALC, as measure have an implicit calculate but no good. but course if i placed the sum after Calculate and
then did the filtering it would.
Excel Formula:
CALCULATE(SUM(pTaverage[units]) ,FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdatee ) )
CALCULATE(SUM(pTaverage[units]) ,FILTER(ALL(pTaverage[date]),pTaverage[date] <= mdatee ) )