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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Michael1
Advocate II
Advocate II

Finding the most recent value change

Hello BI Community:

 

I am trying to create a calculated column that indicates if data for each school is the most recent based on a completion time.

 

data.png

 

The current column, isLastEntryforDay is calculated with this code:

 

isLastEntryforDay = 
	if((TenDayCount[Completion time])=MAXX(
		FILTER(
			TenDayCount,
			TenDayCount[School]=EARLIER(TenDayCount[School])
		),
		TenDayCount[Completion time]),
	true(),
	false()
	)

However, I really want it to return true if it is the last entry based on the Day column.  Not overall. 

 

I would be grateful if anyone could help me modify the DAX (or provide an alternative solution) to accomplish this.

 

Thank you,

 

Michael

1 ACCEPTED SOLUTION
Michael1
Advocate II
Advocate II

The solution I used to solve this was to create a new custom column

 

= Table.AddColumn(#"Replaced Errors", "SchoolDay", each [Day]&","&[Code])

Then, I used the same code as before to determine the most recent entry.

 

Michael

View solution in original post

3 REPLIES 3
Michael1
Advocate II
Advocate II

The solution I used to solve this was to create a new custom column

 

= Table.AddColumn(#"Replaced Errors", "SchoolDay", each [Day]&","&[Code])

Then, I used the same code as before to determine the most recent entry.

 

Michael

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Michael1,



However, I really want it to return true if it is the last entry based on the Day column.  Not overall. 

I'm not sure I understand your requirement totally. Could you be more precisely with it by posting your expected result against the sample data you posted above? Smiley Happy

 

Regards

Greg_Deckler
Community Champion
Community Champion

So, regardless of month and year, if it is the highest day number? So, Jan 30th, 1956 would be the last day versus Dec 29, 2017?

 

Apologies if I am not understanding something.



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...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.