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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Solution Sage
Solution Sage

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
Solution Sage
Solution Sage

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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