Forum Discussion
GiangLe
Helper I
8 years agoYear to date without standard date table
Hi everyone, I've struggled with this problem for few days already and would be glad if someone can help me out :). I'm working a dataset without a standard date column (as you can see in the pho...
- 8 years ago
YTD Measure := CALCULATE ( SUM ( Table[Sales] ), FILTER ( ALL ( Table[Yearmonth] ), Table[Yearmonth] <= MAX ( Table[Yearmonth] ) ) )But if measure needs to cross "Years", you'll need a separate column for Year and add to filter statement.
Or do like suggested and convert your Yearmonth column to a date, then use time intelligence.
mattbrice
Solution Sage
8 years agoYTD Measure :=
CALCULATE (
SUM ( Table[Sales] ),
FILTER (
ALL ( Table[Yearmonth] ),
Table[Yearmonth] <= MAX ( Table[Yearmonth] )
)
)But if measure needs to cross "Years", you'll need a separate column for Year and add to filter statement.
Or do like suggested and convert your Yearmonth column to a date, then use time intelligence.
GiangLe
Helper I
8 years agoApparently, i now fully understand what you said ealier :). I'd like to add year into my filter too so i could calculate cross year. However, none of those dax i've tried work. Could you help?