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
Midway
Helper I
Helper I

Help with a DAX YTD Cummulative Query

Hi there, 

 

I'm trying to show in a card the YTD Sales budget in a cummulative way. So when a Month (data point) is selected in a Bar Chart, the Card is supposed to show the Cummulative Sales budget for the month. So from the table below, if January is selected, the Card will show 10, if February is selected the card will show 23 or so on. If no selection, the card will show the sum of all months in the table.

 

Can someone help me to figure this out? 

 

DateSaleBudget
2025-01-31    10
2025-02-28    13
2025-03-31    50
2025-04-30    20
2025-05-31    30
2025-06-30    90
2025-07-31    30
2025-08-31    65
2025-09-30    45
2025-10-31    20
2025-11-30    78
2025-12-31    65

 

Many thanks in advance!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

One of ways is using DATESYTD DAX function in the measure.

 

DATESYTD function (DAX) - DAX | Microsoft Learn

 

Jihwan_Kim_1-1742530076148.png

 

 

Jihwan_Kim_0-1742530064084.png

 

Sales Budget YTD: = 
CALCULATE (
    SUM ( budget[salesbudget] ),
    DATESYTD ( 'calendar'[Date], "12-31" )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Deku
Super User
Super User

Var maxdt = max(table[date])

Return

Calculate (

Sum( table[sales budget]),

Table[date] <= maxdt &&

Year(Table[date] ) = year(table[date])

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

One of ways is using DATESYTD DAX function in the measure.

 

DATESYTD function (DAX) - DAX | Microsoft Learn

 

Jihwan_Kim_1-1742530076148.png

 

 

Jihwan_Kim_0-1742530064084.png

 

Sales Budget YTD: = 
CALCULATE (
    SUM ( budget[salesbudget] ),
    DATESYTD ( 'calendar'[Date], "12-31" )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
ThxAlot
Super User
Super User

Bring your DAX skill to the next level.

ThxAlot_0-1742545182445.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (27)