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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Adam01
Advocate I
Advocate I

Sum of Amount for Previous Custom Financial Year

Hi All!

 

I am trying to calculate the totals for a custom financial year but for last year

 

For example the current financial year is 26th of March 2022 to the 25th of March 2023.

So I would need the total for the previous financial year of 26th of March 2021 to the 25th of March 2022

 

For Current Year I have the following DAX:

Amount YTD = TOTALYTD ( SUM ( 'Sales'[Sales] ), 'Calendar'[Date]. "25/03" )

This returns the Correct value for the current financial year (1.33bn)

 

However when I do previous financial year:

CALCULATE (
        [Amount YTD],
        SAMEPERIODLASTYEAR ( 'Calendar'[Date] )
    )
It returns (Blank), see below:
Adam01_1-1667385402126.png

 

I should be expecting to see a value of 1.87bn


I am unsure where to go from here, I have tried PARALLELPERIOD and DATEADD but they return the same result

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Adam01 ,

I created some data:

Sales:

vyangliumsft_0-1667464651625.png

Calendar:

vyangliumsft_1-1667464651626.png

Here are the steps you can follow:

1. Create measure.

current financial year =
var _today=TODAY()
var _currentdate=DATE(YEAR(_today),3,25)
var _nextdate=DATE(YEAR(_today)+1,MONTH(_currentdate),DAY(_currentdate))
return
SUMX(FILTER(ALL('Calendar'),'Calendar'[Date]>_currentdate&&'Calendar'[Date]<=_nextdate),SUMX(FILTER(ALL('Sales'),'Sales'[Date]='Calendar'[Date]),[Sales]))
previous financial year =
var _today=TODAY()
var _currentdate=DATE(YEAR(_today),3,25)
var _previousdate=DATE(YEAR(_today)-1,MONTH(_currentdate),DAY(_currentdate))
return
SUMX(FILTER(ALL('Calendar'),'Calendar'[Date]>_previousdate&&'Calendar'[Date]<=_currentdate),SUMX(FILTER(ALL('Sales'),'Sales'[Date]='Calendar'[Date]),[Sales]))

2. Result:

vyangliumsft_2-1667464651628.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @Adam01 ,

I created some data:

Sales:

vyangliumsft_0-1667464651625.png

Calendar:

vyangliumsft_1-1667464651626.png

Here are the steps you can follow:

1. Create measure.

current financial year =
var _today=TODAY()
var _currentdate=DATE(YEAR(_today),3,25)
var _nextdate=DATE(YEAR(_today)+1,MONTH(_currentdate),DAY(_currentdate))
return
SUMX(FILTER(ALL('Calendar'),'Calendar'[Date]>_currentdate&&'Calendar'[Date]<=_nextdate),SUMX(FILTER(ALL('Sales'),'Sales'[Date]='Calendar'[Date]),[Sales]))
previous financial year =
var _today=TODAY()
var _currentdate=DATE(YEAR(_today),3,25)
var _previousdate=DATE(YEAR(_today)-1,MONTH(_currentdate),DAY(_currentdate))
return
SUMX(FILTER(ALL('Calendar'),'Calendar'[Date]>_previousdate&&'Calendar'[Date]<=_currentdate),SUMX(FILTER(ALL('Sales'),'Sales'[Date]='Calendar'[Date]),[Sales]))

2. Result:

vyangliumsft_2-1667464651628.png

 

Best Regards,

Liu Yang

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

Greg_Deckler
Community Champion
Community Champion

@Adam01 For custom fiscal calendars, you can pretty much forget about DAX time intelligence functions. Although there is a possible solution using TOTALYTD. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

Also for a treatment of TOTALYTD using optional parameters for "fiscal year", see this video:



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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