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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
cca8380
Frequent Visitor

SAMEPERIODLASTYEAR Issues

I tried solving my issue by reviewing other post on this topic but I seem to be stuck. I am unable to get the

SAMEPERIODLASTYEAR function to work for me. Any help would be greatly appreciated.
 
Total_Sales = SUM(Data[Amount]) --> working great
Sales_YTD = TOTALYTD(Data[Total_Sales],'Data'[DATE]) --> working great
Sales_LYTD = CALCULATE(sum(Data[Amount]), SAMEPERIODLASTYEAR('Calendar'[Date])) --> not so much
 
Current Output --- Sales_LYTD same as Sales_YTD... Please help!
YearTotal_SalesSales_YTDSales_LYTD
2015$67,878,999,619.50$67,878,999,620$67,878,999,619.50
2016$78,764,797,884.73$78,764,797,885$78,764,797,884.73
2017$91,052,871,681.36$91,052,871,681$91,052,871,681.36
2018$97,214,994,268.74$97,214,994,269$97,214,994,268.74
2019$66,070,917,033.61$66,070,917,034 
 
 
 
 
 
2 REPLIES 2
amitchandak
Super User
Super User

You can Try below DateYTD or Total YTD

 

Last Year YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date Filer],-12,MONTH)))

 

 

Also in one calculation, you are passing data[date] another one calendar date. Just check the join is correct.

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

Hi @cca8380 ,

I'd like to suggest you use date function ot manually defined filter range instead to use time intelligence function, it requires a calendar table and not allow you to nest multiple time intelligence functions.

Time Intelligence "The Hard Way" (TITHW)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.

Top Kudoed Authors