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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MohamedAliEid
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

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
)

 

Dangar332_0-1704180370336.png

 

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @MohamedAliEid 

 

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.

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)
Capture.JPGCapture2.JPG

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
)

 

Dangar332_0-1704180370336.png

 

lbendlin
Super User
Super User

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.