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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AmberM
Helper II
Helper II

YTD Prior Year based on Fiscal Calendar YYYYWW

I am struggling with creating the formula for YTD prior year that cumulates based on current YTD.

 

My Current YTD Sales formula is working:

YTD Sales = 
[Total Sales](
                FILTER(
                  ALL(FYCalendar),
                  FYCalendar[FY Week Nbr]<=MAX(FYCalendar[FY Week Nbr])
                ),
                VALUES(FYCalendar[FY])
             )

When I try to create the formula for Prior YTD Sales, I receive an error:

YTD Sales Prior Year = 
    [Total Sales],
      FILTER(ALL(FYCalendar),
          FYCalendar[FY Week Nbr]=MAX(FYCalendar[FY Week Nbr]) - 1),
          VALUES(FYCalendar[FY])
)

How do I fix the prior year expression for YTD based only on time accumulated for the current YTD?

 

Thanks so much if you can assist!

 

4 REPLIES 4
v-xjiin-msft
Solution Sage
Solution Sage

Hi @AmberM,

 

Could you please share us more information about your report if possible? Like your source table structure and some sample data with corresponding expected result. So that we can know the right direction and make some proper tests. Smiley Happy

 

Thanks,
Xi Jin.

Here is a sample file on OneDrive with a few iterations of trying to create YTD Sales that accumulate for the prior year. Please let me know if you have issues accessing the file, and thank you for your assistance!

 

https://1drv.ms/u/s!AoY5sA-v6cUciH3yi2ZGonBagbbG

Hi,

 

In the Sales Table, you do not have a date column - only a Week column.  In the source from where you are downloaidng, do you have a Date column?  If not a date colun, even if you have month and year in 2 seperate columns, we can always generate a date.

 

Having a date column will allow us to use DAX's Date and Time Intelligence functions.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Unfortunately that is my issue. The data only returns with a fiscal YYYYWW which does not match a calendar year. I am not able to use DAX calculations to create the prior year expressions.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.