Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
GiangLe
Helper I
Helper I

Year 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 photo) and i would like to achieve YTD sales in the third column. (i know that i can create a date table and map that one with this table, i've tried that but still the already available YTD dax function didnt work)
31-01-2018 5-11-17 PM.png
Thanks

 

1 ACCEPTED SOLUTION
mattbrice
Solution Sage
Solution Sage

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.

View solution in original post

4 REPLIES 4
mattbrice
Solution Sage
Solution Sage

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.

Apparently, 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? 

Thanks! I've tried your method and it worked like a charm in my sample data but somehow acted weird in my real dataset. I'm looking deeper into this, but i think this is the way to go.

corbusier
Advocate IV
Advocate IV

Have you tried using LEFT() and RIGHT() combined with DATE() to make a date out of the yearmonth field? This should then enable you to use the regular time intelligence functions.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors