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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am trying to get a calculated column as "Flag" which should populate "Yes" or "No" based on below conditions
1. Status = "Failed"
2. The date should be the latest within the Name group
Below is the sample table and expected output of the Flag Outcome
for example - the first row for XYZ satisfies the above condition and should be YES.
Name | Status | Date | Flag |
ABC | Completed | 4/29/2020 4:02 | No |
ABC | Completed | 4/28/2020 4:02 | No |
ABC | Failed | 4/16/2020 5:02 | No |
ABC | Failed | 4/15/2020 5:02 | No |
ABC | Completed | 4/14/2020 5:04 | No |
ABC | Completed | 4/13/2020 5:02 | No |
XYZ | Failed | 4/26/2020 11:03 | Yes |
XYZ | Failed | 4/25/2020 11:03 | No |
XYZ | Failed | 4/24/2020 11:03 | No |
XYZ | Failed | 4/23/2020 11:03 | No |
XYZ | Completed | 4/22/2020 11:03 | No |
XYZ | Completed | 4/21/2020 11:03 | No |
XYZ | Completed | 4/20/2020 11:03 | No |
XYZ | Failed | 4/19/2020 11:03 | No |
XYZ | Completed | 4/18/2020 11:03 | No |
PQR | Failed | 10/24/2019 11:32 | Yes |
PQR | Failed | 10/24/2019 11:32 | No |
PQR | Failed | 10/24/2019 11:32 | No |
LMN | Failed | 3/6/2020 11:03 | No |
LMN | Failed | 3/5/2020 11:03 | No |
LMN | Failed | 3/4/2020 11:03 | No |
LMN | Failed | 3/3/2020 11:03 | No |
LMN | Completed | 3/2/2020 11:03 | No |
LMN | Completed | 3/2/2020 10:36 | No |
DEF | Failed | 4/28/2020 15:12 | Yes |
DEF | Failed | 4/28/2020 15:12 | No |
DEF | Failed | 4/28/2020 15:12 | No |
DEF | Failed | 4/28/2020 15:12 | No |
DEF | Completed | 4/27/2020 13:32 | No |
DEF | Completed | 4/16/2020 12:22 | No |
DEF | Completed | 3/18/2020 19:23 | No |
DEF | Completed | 2/24/2020 10:26 | No |
Perhaps something along the lines of:
Flag =
VAR __MaxDate = MAXX(FILTER('Table',[Name] = EARLIER('Table'[Name])),[Date])
RETURN
IF([Status] = "Failed" && [Date] = __MaxDate,"Yes","No")
Thank You! This was great!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.