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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
seenai
Helper II
Helper II

Add a Column with most recent value

Hi,

 

I need to add a Column Like in Example. (in Power BI Query)

  • Get the column, filled with Last Record Name in Column Base-HardenerCode
    Please help me with formula to add Custom Column.

seenai_0-1632311947356.png

 

2 ACCEPTED SOLUTIONS

Hello 

Sorry abouth the delay.

My approach to you:

 

onurbmiguel__0-1632693784498.png

 

onurbmiguel__1-1632693808103.png

if [Date] = List.Max(#"Changed Type"[Date]) then [ID] else null

the ideia is to find do max of the date e the return de respective ID ,

onurbmiguel__3-1632694081432.png

 

after you make a Fill Up, 

onurbmiguel__2-1632693997606.png

 

I hope that's it

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Best Regards
BC

 

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


View solution in original post

PhilipTreacy
Super User
Super User

Hi @seenai 

Download this PBIX file with the following code

As an alternative, you can do this in 1 line without needing to fill up:

#"Changed Type"[#"Base-HardenerCode"]{List.Count(#"Changed Type"[#"Base-HardenerCode"])-1}

You just need to change the reference to the previous step from #"Changed Type" to whatever the step name is before where you insert this line into your code.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
v-easonf-msft
Community Support
Community Support

Hi,  @seenai 

Could you please tell me whether your problem has been solved?

For now, there is no content of description in the thread. If you still need help, please share more details to us.

 

Best Regards,
Community Support Team _ Eason

PhilipTreacy
Super User
Super User

Hi @seenai 

Download this PBIX file with the following code

As an alternative, you can do this in 1 line without needing to fill up:

#"Changed Type"[#"Base-HardenerCode"]{List.Count(#"Changed Type"[#"Base-HardenerCode"])-1}

You just need to change the reference to the previous step from #"Changed Type" to whatever the step name is before where you insert this line into your code.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


It works as required. Great Support.

Thank You Very much.

onurbmiguel_
Power Participant
Power Participant

Hello, 

From your image i see that "Base-HardenerCode" is text, is there a date field to control the most recente? 

 

Best regards

BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Hi ,

Help me with formula to add Custom Column, Like in Example. (in Power BI Query)

  • Get the column, filled with Last Record Name in Column Base-HardenerCode

  • seenai_0-1632404936288.png

     

Hello 

Sorry abouth the delay.

My approach to you:

 

onurbmiguel__0-1632693784498.png

 

onurbmiguel__1-1632693808103.png

if [Date] = List.Max(#"Changed Type"[Date]) then [ID] else null

the ideia is to find do max of the date e the return de respective ID ,

onurbmiguel__3-1632694081432.png

 

after you make a Fill Up, 

onurbmiguel__2-1632693997606.png

 

I hope that's it

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Best Regards
BC

 

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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 Solution Authors