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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
M_SBS_6
Helper V
Helper V

Max Datetime flag

Hi, 

I have records which have a datetime field called called app_in_datetime

 

I'd like to create a new field which will flag the records of the latest datetime.

 

Example below.

app_in_datetime.         Latest_app_in

01/01/2023 12:34:45.    N

01/01/2023 13:53:34.    Y

 

Any idea how I would go about doing this please? 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Assuming you have an App ID column and you want a Y or an N against each App ID, try this calculated column formula

Result = if(Data[app_in_datetime]=calculate(max(Data[app_in_datetime]),filter(Data,Data[App ID]=earlier(Data[App ID]))),"Y","N")

Hope this helps.


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

@M_SBS_6 , Try a new column like

 

if([app_in_datetime] = max(Table[app_in_datetime]) , "Y", "N" )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.