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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have two tables with application ID in both table having relationship.
First Table
| Application ID | Closed DateTime | Tat | Closed Flag |
| 1 | 23-09-2021 | 30 | No |
| 1 | 24-09-2021 | 45 | Yes |
| 1 | 25-09-2021 | 56 | Yes |
Second Table
| Application ID | TAT (Calculated Col) |
| 1 | 56 |
I need to create a calculated column "TAT" in the second table which brings the TAT value for a maximum ClosedDateTime of a Application ID and Closed Flag should be "Yes".
Please help me with DAX for this.
Solved! Go to Solution.
@Anonymous This is essentially Lookup Min/Max: Lookup Min/Max - Microsoft Power BI Community. In your case:
TAT Column =
VAR __Date = MAXX(FILTER(RELATEDTABLE('First Table'),[Closed Flag]="Yes"),[Closed DateTime])
VAR __Tat = MAXX(FILTER(RELATEDTABLE('First Table'),[Closed Flag]="Yes" && [Closed DateTime]=__Date),[Tat])
RETURN
__Tat
@Anonymous This is essentially Lookup Min/Max: Lookup Min/Max - Microsoft Power BI Community. In your case:
TAT Column =
VAR __Date = MAXX(FILTER(RELATEDTABLE('First Table'),[Closed Flag]="Yes"),[Closed DateTime])
VAR __Tat = MAXX(FILTER(RELATEDTABLE('First Table'),[Closed Flag]="Yes" && [Closed DateTime]=__Date),[Tat])
RETURN
__Tat
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 45 | |
| 38 | |
| 26 | |
| 23 |
| User | Count |
|---|---|
| 133 | |
| 120 | |
| 58 | |
| 37 | |
| 31 |