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
sid-poly
Helper I
Helper I

YTD for Previous Sales Calculation Throwing an Error

I need to calculate the YTD for the previous year and have come up with the formula listed below 

 

CALCULATE(SUM(financials[ Sales]), FILTER(financials,financials[Year]=2014 && DATESYTD(financials[Date].[Date])))

 

 

and have tried 

 

CALCULATE(SUM(financials[ Sales]), FILTER(financials,financials[Year]= "2014" && DATESYTD(financials[Date].[Date])))

 

 

Case

 

Case 1 :In the 1st case it is throwing an error : A table of multiple values have been supplied where as a single value was expected

 

Case 2 : It doesn't support comparing values of type integer with values of type text. Try using FORMAT function.

 

Please help me in re correcting on the measure part

3 REPLIES 3
sid-poly
Helper I
Helper I

@amitchandak - Can you help here?

ChiragGarg2512
Solution Sage
Solution Sage

Always use date table and not .[date].

 

Refer to this video/blog for correction:

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

I did use the Date Table, but yet, it doesn't provide me with the solution

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.