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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
jsteffe
Helper III
Helper III

Problem with previousYear function

I gest these 2 measures :

total_of_sales = SUM(Order_details[total_without_discount])
Total_sales_previous_year = CALCULATE([total_of_sales],PREVIOUSYEAR('Calendar'[Date]))
 
I don't understand why when I want to presnet my results by year and buy month it doesn't work :
ex.png
In my second table, I would like to get the total of sales for last year month by month and Power BI calculates the total of sales for year 1996 (see photo).
 
Thanks for your help,
 
Jérôme
1 ACCEPTED SOLUTION
linh091
Resolver I
Resolver I

Can you share your file with shorten data? I want to see what's your date format.

View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

Try:

Total_sales_previous_year = CALCULATE([total_of_sales], DATEADD('Calendar'[Date], -1, YEAR))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






linh091
Resolver I
Resolver I

Can you share your file with shorten data? I want to see what's your date format.

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.

Top Solution Authors