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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
alexburn
New Member

Latest value after filters

Hi guys,

 

Here is an example of my raw data:

 

Job______Period___Date______________Progress____
11111N101 May 202150
11111N201 June 202160
11111 01 July 20210
22222N101 May 202180
22222N201 June 202190
22222N301 July 202190
22222 01 August 20210
33333 01 June 20210
33333N201 July 202120
33333 01 August 20210

 

What I need to end up with is this:

 

Job______Period___Date______________Progress____LatestProgress__
11111N101 May 20215060
11111N201 June 20216060
11111 01 July 2021060
22222N101 May 20218090
22222N201 June 20219090
22222N301 July 20219090
22222 01 August 2021090
33333 01 June 2021020
33333N201 July 20212020
33333 01 August 2021020

 

In other words...

Find the "progress" against the latest "date" where "period" is not blank.

I've had some success using calculations that return a value for the latest date, but having trouble filtering so that I'm only finding the latest date where the period is not blank.

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column fomula works

=LOOKUPVALUE(Data[Progress____],Data[Date______________],CALCULATE(MAX(Data[Date______________]),FILTER(Data,Data[Job______]=EARLIER(Data[Job______])&&Data[Period___]<>BLANK())),Data[Job______],Data[Job______])

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

This calculated column fomula works

=LOOKUPVALUE(Data[Progress____],Data[Date______________],CALCULATE(MAX(Data[Date______________]),FILTER(Data,Data[Job______]=EARLIER(Data[Job______])&&Data[Period___]<>BLANK())),Data[Job______],Data[Job______])

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you, this worked perfectly!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Portrek
Resolver III
Resolver III


Hi Alexburn

You can create a custon column using the code below.

Max = CALCULATE(MAX(Table[Progress____]),ALLEXCEPT(Table,Table[Job______]))

 

Best regards.

This does not work because the latest date is not always the maximum progress.

Also, it is not checking the [Period] column for blanks to exclude those from the calculation.

Greg_Deckler
Community Champion
Community Champion

@alexburn Seems like:

LatestProgress Column = 
  VAR __Job = [Job]
  VAR __Table = FILTER('Table',[Job] = __Job && NOT(ISBLANK([Period])))
  VAR __Max = MAXX(__Table,[Date])
RETURN
  MAXX(FILTER(__Table,[Date] = __Max), [Progress])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I have tried this and the result returned without error, however, it is not the correct result.

See below example/result (filter to just one job):

 

Job_____Period_____Date_____Progress_____LatestProgres_____
11111N301 July 2021-1000
11111N201 June 2021-1000
11111N101 May 2021-1000
11111C1101 March 202100
11111C1201 April 202100
11111 01 April 2022 0
11111 01 March 2022 0
11111N401 August 2021-1000
11111N501 September 2021-1000

 

I'm not sure if the (negative) -100 has anything to do with it?

I've tried MINX instead of MAXX to test this, but the result was the same.

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.

Top Solution Authors