cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## Calculate the sellout Period over period

Greetings to everyone

I have 2023 sell-out data and I made an automatic refresh for my model so every day in 2024 it will refresh the new data

I am asking if there is anything to compare sell-out per month and day for example 23-Mar 2024 is today how do we compare it to the exact date from last year - periods (1/1/2023 - 23/3/2023) to the YTD data for 2024, if u using dateadd or anything else it will take all month level (till the end of March which I didn't reach yet on the current year) I hope anyone can help me.

1 ACCEPTED SOLUTION
Super User

Hi, @MohamedAliEid

as i understand your problem try below solution

``````salesytdsamelastyear =
var a = EDATE(MIN('Data Date'[Date]),-12)
var b =DATE(YEAR(a),1,1)
return
CALCULATE(
[salesamountm],
'Data Date'[Date]>=b,'Data Date'[Date]<=a
)``````

4 REPLIES 4
Community Support

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regular Visitor

How to compare YTD sell out QTY with the last year but till the same period, for example, if YTD is stopped on (23 March) how do compare it with the previous year (23 March)

Super User

Hi, @MohamedAliEid

as i understand your problem try below solution

``````salesytdsamelastyear =
var a = EDATE(MIN('Data Date'[Date]),-12)
var b =DATE(YEAR(a),1,1)
return
CALCULATE(
[salesamountm],
'Data Date'[Date]>=b,'Data Date'[Date]<=a
)``````

Super User

That's the standard "Previous Year To Date"  pattern.  What have you tried and where are you stuck?

Announcements