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
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
Memorable Member
Memorable Member

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.LeanAndPractise(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.LeanAndPractise(Everyday)


)



Irwan
Memorable Member
Memorable Member

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