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
Anonymous
Not applicable

ytd sales help

Hi experts, need to calculate total sales for the current year  and last year based on the fiscal year (apr - mar). I have year filter in the report. I need to calculate based on the selected year. Please help. 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try to create measures like below:

Sales FYTD = 
TOTALYTD( [Total Sales],
    Dates[Date], ALL( Dates[Date] ), "30-6" 
)
Sales PY FYTD = 
CALCULATE( [Sales FYTD],
    SAMEPERIODLASTYEAR( Dates[Date] )
   
)

Vlianlmsft_0-1647323595603.pngVlianlmsft_1-1647323634394.png

 


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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Using date table and time intelligence

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"3/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"3/31"))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak In my report, year filter only available. Abobe formula will work for date range filter, right?

Hi @Anonymous ,

 

Try to create measures like below:

Sales FYTD = 
TOTALYTD( [Total Sales],
    Dates[Date], ALL( Dates[Date] ), "30-6" 
)
Sales PY FYTD = 
CALCULATE( [Sales FYTD],
    SAMEPERIODLASTYEAR( Dates[Date] )
   
)

Vlianlmsft_0-1647323595603.pngVlianlmsft_1-1647323634394.png

 


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

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.