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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vauban
Helper I
Helper I

Query editor custom column to return most recent date in other column

Hi to all.  I am struggling with how to grab from another column the most recent date and with that date populate an entire new custom column.

The Meeting Date column is Date format.

I have tried these formulas with no success:

List.Max(Date.From[Meeting Date])

Date.From(List.Max([Meeting Date])) (tried both ways to see if anything worked)

 

I can't believe I'm missing this and will really appreciate anyone who can tell me what I am missing.

David

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Vauban , I echo Matt's statement in that I don't understand the end goal, but this is the M code you get you the max date from a column:

 

Add_CustomColumn = Table.AddColumn( Previous_Step, “Custom Column”, each
	List.Max(Previous_Step[Meeting Date]), type date)

You can reference a list with the symtax TableName[ColumnName].  You can add your additional logic to this pattern.

 

Just replace Previous_Step with the name of your step right before it in the query

 

Keep in mind that the step name Filtered Rows is actually #"Filtered Rows" in the advanced editor.  Name your steps with no spaces and you can avoid the #"" syntax.

View solution in original post

3 REPLIES 3

I think the bigger issue is “why are you trying to do this”?  Many new users treat data in Power BI as if it were Excel, but of course it is not Excel. What are you trying to do?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

@Vauban , I echo Matt's statement in that I don't understand the end goal, but this is the M code you get you the max date from a column:

 

Add_CustomColumn = Table.AddColumn( Previous_Step, “Custom Column”, each
	List.Max(Previous_Step[Meeting Date]), type date)

You can reference a list with the symtax TableName[ColumnName].  You can add your additional logic to this pattern.

 

Just replace Previous_Step with the name of your step right before it in the query

 

Keep in mind that the step name Filtered Rows is actually #"Filtered Rows" in the advanced editor.  Name your steps with no spaces and you can avoid the #"" syntax.

Thank you to both for your thoughts and the solution.  My Excel roots haunt me but for the now I just needed an intermediate step to evaluate when meetings where past a certain date.

All the best,

David

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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