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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
NickOIT
New Member

DAX Calculate - Filter max date on several columns

Hi,

 

I'm struggling to figure out how to filter out duplicate rows based on the latest run date for each program and computer.

I think I'm almost there but can't quite figure it out.

 

Here's an example::

ClientIDProgramNameLastRun
1Program12017-12-20
1Program12017-11-01
1Program22017-12-21
2Program12016-01-01

 

What I'm trying for:

ClientIDProgramNameLastRun
1Program12017-12-20
1Program22017-12-21
2Program12016-01-01

 

I found another thread with a similar issue request but they only had a single column that they had to match with the date column. The solution I found there works, but it only filters the latest date per client and not per client & program.

 

 

IsLatestChangedDateByID = Sheet1[LastRun] = 
	CALCULATE(
		MAX(Sheet1[LastRun]); 
		FILTER(ALL(Sheet1); Sheet1[ClientID]=EARLIER(Sheet1[ClientID]))
	)

 

Anybody got any ideas on how I can proceed?

Thanks for any help.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@NickOIT,

Create your column using the dax below.

IsLatestChangedDateByID = 
	CALCULATE(
		MAX(Sheet1[LastRun]);
		FILTER(ALL(Sheet1); Sheet1[ClientID]=EARLIER(Sheet1[ClientID])&&Sheet1[ProgramName]=EARLIER(Sheet1[ProgramName]))
	)


Alternatively, right click your table and select "New Measure", apply DAX below.

Measure = MAX(Sheet1[LastRun])

1.JPG

Regards,
Lydia

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@NickOIT,

Create your column using the dax below.

IsLatestChangedDateByID = 
	CALCULATE(
		MAX(Sheet1[LastRun]);
		FILTER(ALL(Sheet1); Sheet1[ClientID]=EARLIER(Sheet1[ClientID])&&Sheet1[ProgramName]=EARLIER(Sheet1[ProgramName]))
	)


Alternatively, right click your table and select "New Measure", apply DAX below.

Measure = MAX(Sheet1[LastRun])

1.JPG

Regards,
Lydia

 

Thank you so much! 
I was so close, must've written something wrong when I tried it yesteday.

 

I'll try your second suggestion as well after the holidays. 🙂

 

Merry Christmas!

 

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.