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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.