Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Kriszynka113
Contributor
Contributor

Looking for formula

Hello, 

I'm looking for help to find a formula for:

 

Sales Full year to date (back 365 days to today) 

I'm a student and have homework to solve, analysis of the company with sales, margin, etc for the full year to date and the previous full year to date. If anyone can help, please?

Thank you

3 Replies
Anil_Babu_Samineni

MAybe like this with set expression in your measure?

{<DateField={">=Date(AddYears(Today(), -1)) <=Date(Today())"}>}

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Kriszynka113
Contributor
Contributor
Author

Thank you so much. I will test your help tomorrow and ask more questions probably to become a bit more educated 😃

sidhiq91
Specialist II
Specialist II

@Kriszynka113  You can also try the below expression:

Sum({<Date={">=$(=Date(Addyears(Max(Date),-1),'MM/DD/YYYY'))<=$(=Max(Date))"}>}Sales)

The data I have used for the same is as below:

NoConcatenate
Temp:
Load Date(Date#(Date,'DD/MM/YYYY') ,'MM/DD/YYYY') as Date,
Sales

Inline [
Date, Sales
14/11/2023, 100
10/10/2023, 200
13/09/2023, 300
24/08/2023, 400
22/07/2023, 500
21/06/2023, 700
21/05/2023, 500
21/04/2023, 900
21/03/2023, 400
21/02/2023, 800
21/01/2023, 1000
21/12/2022, 900
21/11/2022, 800
21/10/2022, 700
];

Exit Script;

If this resolves your issue, please like and accept it as a solution.