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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
junding9
Regular Visitor

DAX that would give me last year's asset from this year's asset

Using 3 columns (Date, Name, This year asset), what DAX via "New column" (not via "New measure") would give me last year asset exactly as below? Please assume that 3 columns (Date, Name, This year asset) are all 'columns' too (not 'measures').

 

I want a New column named "Last year asset":

 

Last year asset = ?

 

DateNameThis year assetLast year asset
7/10/2023Paul$134$897
7/10/2022Paul$897$965
7/10/2021Paul$965n/a
4/13/2021Tony$322$468
4/13/2020Tony$468n/a
2/26/2024Christine$230$763
2/26/2023Christine$763$797
2/26/2022Christine$797$865
2/26/2021Christine$865n/a
6/19/2023Bella$983$142
6/19/2022Bella$142$337
6/19/2021Bella$337$47
6/19/2020Bella$47n/a

 

 

2 ACCEPTED SOLUTIONS
Irwan
Super User
Super User

hello @junding9 

 

please check if this accomodate your need.

Irwan_3-1720746077638.png

 

Create a calculated column with following DAX:

Last year asset =
var _LastYearDate = MAXX(FILTER('Table','Table'[Date]<EARLIER('Table'[Date])&&'Table'[Name]=EARLIER('Table'[Name])),'Table'[Date])
Return
CALCULATE(MAX('Table'[This year asset]),FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Date]=_LastYearDate))
Irwan_1-1720746026654.png

 

Hope this will help you.

Thank you.

View solution in original post

ThxAlot
Super User
Super User

ThxAlot_0-1720767801932.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

ThxAlot_0-1720767801932.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Irwan
Super User
Super User

hello @junding9 

 

please check if this accomodate your need.

Irwan_3-1720746077638.png

 

Create a calculated column with following DAX:

Last year asset =
var _LastYearDate = MAXX(FILTER('Table','Table'[Date]<EARLIER('Table'[Date])&&'Table'[Name]=EARLIER('Table'[Name])),'Table'[Date])
Return
CALCULATE(MAX('Table'[This year asset]),FILTER('Table','Table'[Name]=EARLIER('Table'[Name])&&'Table'[Date]=_LastYearDate))
Irwan_1-1720746026654.png

 

Hope this will help you.

Thank you.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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