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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Power Query Max Date for Multiple User IDs

Hello all,

 

I am looking for help for what was a very easy thing to deliver as a custom column using a simple MAX statement. Here is some test data. Essentially I need to figure out how to build the Maxdate column below in Power Query in order to merge it with a terminated associate data set. 

 

Effective DateAssociate IDMaxdate
3/31/202220053/31/2022
2/28/202220053/31/2022
1/31/202220053/31/2022
3/31/202220063/31/2022
2/28/202220063/31/2022

1/31/2022

20063/31/2022

11/30/2021

300011/30/2021

10/31/2021

300011/30/2021

9/30/2021

300011/30/2021

 

I imagine it will be something similar to this article, but I am still a novice, and can't figure out to how do it for each specific user ID.

 

Thanks in advance!

1 ACCEPTED SOLUTION
HotChilli
Community Champion
Community Champion

Duplicate the table.

Perform a 'Group By' on ID with Max (Effective Date)

----

Use Merge Queries to join the resulting table with the original table ( joining on ID)

View solution in original post

3 REPLIES 3
HotChilli
Community Champion
Community Champion

I need to combat this whenever I see it.

It's not good practice to base a calculated column on a measure.  The column gets a value when data is loaded or refreshed.

A measure is intended for visualisations. It evaluates depending on the context it is used in.

You will get a value when a column is based on a measure but it might not be what you hope for (so it shouldn't be used this way).

If you want a DAX column it will be :

CALCULATE( MAX(active[Effective Date]),ALLEXCEPT(active, active[Associate ID]))
Anonymous
Not applicable

Appreciate the answer! For those looking, I was able to do this another way via measures and custom columns. Note: the tables are linked on associate ID.

 

1. Create a measure for max date from one table: 

Test MaxDate = MAX('active'[Report Effective Date])

 

2. Using a custom column on the termianted table, create a new column, and point it to the new measure: 

MaxDateValidation = [Test MaxDate]
 
This pulled in the maximum that the associate ID appeared on my active table. I was then able to do a simple IF custom column to detect if an associate was a rehire or not.

 

HotChilli
Community Champion
Community Champion

Duplicate the table.

Perform a 'Group By' on ID with Max (Effective Date)

----

Use Merge Queries to join the resulting table with the original table ( joining on ID)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.