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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Be-ro92
Regular Visitor

YTD Sales by Fiscal Year and Filter by Month

Hello,

I am trying to create a measure where I can calculate the YTD sales for a fiscal year starting in Oct-YYYY. I would then like to select a month within the fiscal year and have it roll up the total sales for any previous months.

My issue is that using the DATESYTD function tries to look sum data from the most recent calendar year. But I only want to show the YTD for the fiscal year.

For example. If calendar year 2023 data is available and I filter my visual by "December" then the DATESYTD function will try to find sales December 2023 and will end up being blank. 

By selecting December, I only want to the YTD sales to calculate up to the current FY 2022 December and ignore anything from calendar year 2023.

DateMonthly SalesYTD Sales
Oct-22$100$100
Nov-22$200$300
Dec-22$500$800
Jan-23$50$850
1 ACCEPTED SOLUTION
ghoshabhijeet
Solution Supplier
Solution Supplier

Hi@Be-ro92,  Thanks for your query.

You can use TOTALYTD function instead of DATESYTD. While using the TOTALYTD function, you can define the end month of your fiscal year.

For example:
Total YTD Sales = TOTALYTD([Total Sales], FiscalYearCalendar(Date), "10,31")

This would help you calculate the YTD values till the selected month on your slicer.

For any further assistance, please share the pbix file. Thanks!

** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !

Good Luck 👍

 

View solution in original post

1 REPLY 1
ghoshabhijeet
Solution Supplier
Solution Supplier

Hi@Be-ro92,  Thanks for your query.

You can use TOTALYTD function instead of DATESYTD. While using the TOTALYTD function, you can define the end month of your fiscal year.

For example:
Total YTD Sales = TOTALYTD([Total Sales], FiscalYearCalendar(Date), "10,31")

This would help you calculate the YTD values till the selected month on your slicer.

For any further assistance, please share the pbix file. Thanks!

** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !

Good Luck 👍

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.