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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
amart
Frequent Visitor

DAX Measure for Max Column Value Based on Date

Hey everyone, 

 

I've been at this for a while, it feels like it shouldnt be this hard. Any help greatly appreciatied.

 

I have a table of data with Corporate Officers - I want to show the MAX DATE or MOST RECENT DATE for each Officer Position. In other words, if we appoint a new Secretary, President etc. in this expression I only want to show the MOST RECENTLY appointed officer. 

 

Below is a sample of the table - highlighted are the officers that have been superceeded by new appointees.

 

amart_0-1709759483999.png

 

Thank again!

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Do a grouping on the company id and  position and aggregate by max appointment_date, but add a "all rows" aggregate.

Then expand the tables back out (without the company id and position fields) and then mark all rows where the appointment_date matches the max appointment date.

View solution in original post

Anonymous
Not applicable

Hi @amart ,

 

Your requirement is to keep the row with the largest appointment_date if company_id and position are same.

 

Please follow my steps if I understand you correctly:

 

My approach is somewhat similar to @lbendlin is, with slight differences in the details, thank him very much.

 

Go to Power Query and select company_id and position columns for group by.

vhuijieymsft_0-1709797626171.png

vhuijieymsft_0-1709797698406.png

 

To this step has realized your needs.

vhuijieymsft_2-1709797626174.png

 

If you have other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @amart ,

 

Your requirement is to keep the row with the largest appointment_date if company_id and position are same.

 

Please follow my steps if I understand you correctly:

 

My approach is somewhat similar to @lbendlin is, with slight differences in the details, thank him very much.

 

Go to Power Query and select company_id and position columns for group by.

vhuijieymsft_0-1709797626171.png

vhuijieymsft_0-1709797698406.png

 

To this step has realized your needs.

vhuijieymsft_2-1709797626174.png

 

If you have other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

lbendlin
Super User
Super User

Do a grouping on the company id and  position and aggregate by max appointment_date, but add a "all rows" aggregate.

Then expand the tables back out (without the company id and position fields) and then mark all rows where the appointment_date matches the max appointment date.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.