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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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_
Super User
Super User

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.