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
tomislav_mi
Helper II
Helper II

Same period last year calculated column based on a condition

Hey guys,

I am struggling with how to get one challenging calculated column. I appreciate every help I can get.

This is my data set and the desired calculated column is in orange.

So, I am trying to compare Ending MRR of every customer and it's Ending MRR in the same period last year, and if the previous year Ending MRR is blank, I would need to get current Ending MRR.

Basically, I want to test is there any customer who was not active last year and is active now.

CustomerReport DateEnding MRRSame period last year MRR
A2/28/2019236 
A3/31/2019236 
A4/30/2019236 
A12/31/2019  
B6/30/2018  
B7/31/2018  
B8/31/2018  
B9/30/2018  
B10/31/2018  
B11/30/2018  
B12/31/2018  
B1/31/2019  
B2/28/2019  
B3/31/2019  
B4/30/2019  
B5/31/2019  
B6/30/2019  
B7/31/2019  
B8/31/2019316316
B9/30/2019316316
B10/31/2019316316
B11/30/2019316316
B12/31/2019316316
B1/31/2020316316
B2/29/2020316316

 


Any help is welcome.

Thanks!

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

So you normally need a separate date table for time intelligence functions like SAMEPERIODLASTYEAR. https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax

 

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...



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.