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
kisti_ps
New Member

DAX

I have data like this :

DateUnit Sales
Jan-9763
Feb-9726
Mar-9720
Apr-9741
May-9783
Jun-9740
Jul-9788
Aug-9795
Sep-9774
Oct-9767
Nov-9752
Dec-9710
Jan-9835
Feb-9875
Mar-9832
Apr-9846
May-9837

 

If I want to calculate YTD 1997, it's not Full Year in 1997 but until May 1997 like YTD 1998 until May 1998. So do I if I want to calculate YTD 1996, it's until May 1996. Thanks for the solution

1 REPLY 1
ibarrau
Super User
Super User

Hi. First of all you need to understand that any time intelligence calculations work with a Date Table. Date table are necesary so the engine can run specific time calculations la year to date. Once you hace this data model prepared you can create a measure like this:

 
Measure YTD =
CALCULATE (
    [Measure Unit Sales],
    DATESYTD (
        'DateTable'[Date],
        "04/30"
    )
)
 
On this case the YTD will start on May 1st.
Regards,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.