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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ammartino44
Helper III
Helper III

YTD not working

I'm looking all over the place to figure out how to get YTD numbers to stop at the last month where there is information for the month. [Actual $] below only goes to the end of August, but the YTD goes to the end of the year and is just flat for the final four months. I don't understand. 

 

YTD Actual:=CALCULATE([Actual $],filter(DATESYTD(DateTable[Date]),[Actual $]>0))

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@ammartino44

 

In DAX, the DATESYTD() return the table of YTD dates in current context, which means it applies on each row. Based on your expression, I assume you want to calculate the YTD on an filtered table context. Please refer to my sample formula below:

 

Conditional YTD = CALCULATE(SUM('Table'[Amount]),filter(ALL('Table'),'Table'[Amount]>10 && 'Table'[Date]<=MAX('Table'[Date])))

88.PNG

 

Regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.