MikeManwaring
New member
- Joined
- Apr 19, 2016
- Messages
- 8
- Reaction score
- 0
- Points
- 0
Hi All
i am having difficulty understanding why the following does not work. i have read many articles on variables and do not see why this would makes a difference.
this formula gives me 8 = MONTH(LASTDATE(OrderLines[OrderDate]))
if i put this formula below instead of the hardcoded 8 the measure does not work. where it works ok with hardcoded 8?
CumulativeExVAT =
var cmonth = 8
var cyear = 2016
RETURN
CALCULATE (
SUM ( OrderLines[ExVatValue] )
, FILTER (
ALL ( DimDates ),
DimDates[Day] <= MAX ( DimDates[Day] )
&& DimDates[Month Number] = cmonth
&& DimDates[Year] = cyear
)
)
thanks for any advice
Mike
i am having difficulty understanding why the following does not work. i have read many articles on variables and do not see why this would makes a difference.
this formula gives me 8 = MONTH(LASTDATE(OrderLines[OrderDate]))
if i put this formula below instead of the hardcoded 8 the measure does not work. where it works ok with hardcoded 8?
CumulativeExVAT =
var cmonth = 8
var cyear = 2016
RETURN
CALCULATE (
SUM ( OrderLines[ExVatValue] )
, FILTER (
ALL ( DimDates ),
DimDates[Day] <= MAX ( DimDates[Day] )
&& DimDates[Month Number] = cmonth
&& DimDates[Year] = cyear
)
)
thanks for any advice
Mike