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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mthomas1973
Helper I
Helper I

YTD and SAMEPERIODLASTYEAR

Hello all. I hope someone can help. 

 

I am dipping my toes into time intelligent function for the first time and have a result I can't understand. 

 

I have a couple of measures: 

 

ytd actual = TOTALYTD([Actual],'oa FactPeriodEndBalance'[PeriodEndDate],"31/03")
and
py actual = calculate([Actual],SAMEPERIODLASTYEAR('oa FactPeriodEndBalance'[PeriodEndDate]))
 
I then use these in table that looks like this 
 mthomas1973_3-1634030894051.png

 

Everything works great (there are also other sections, all of which behave as I expected). The oddity is that Fair Value Adj figure. The amount sits in the period 31/3/2021 so should be in the previous financial year not this one?

 

It is worth noting that the total (2,089K) in the matrix ignores that Fair Value amount and is the sum of sales and interest only.

 

Am I missing something obvious? Any help is appreciated.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mthomas1973 , prefer to use date table

 

ytd actual = TOTALYTD([Actual],'Date'[Date],"31/03")

 

Last ytd actual = TOTALYTD([Actual],dateadd('Date'[Date],-1, year) ,"31/03")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mthomas1973 , prefer to use date table

 

ytd actual = TOTALYTD([Actual],'Date'[Date],"31/03")

 

Last ytd actual = TOTALYTD([Actual],dateadd('Date'[Date],-1, year) ,"31/03")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

That's great thank you. Yes, seems to be behaving more normally now -- really appreciate the steer 

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!

December 2024

A Year in Review - December 2024

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