Forum Discussion
jsteffe
4 years agoHelper 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 :
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
Can you share your file with shorten data? I want to see what's your date format.
2 Replies
Replies have been turned off for this discussion
- linh091Resolver I
Can you share your file with shorten data? I want to see what's your date format.
- PaulDBrownCommunity Champion
Try:
Total_sales_previous_year = CALCULATE([total_of_sales], DATEADD('Calendar'[Date], -1, YEAR))