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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.