Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
Im trying to lookup a value from another table with MAX
I have two data tables like this:
Table1:
Table2:
What I'd like to do is, for the empty values in "Table2[Latest Result]" to find the value in "Table1[Result]" based on the highest number in "Table1[Unix]", so i get the latest update from each ID.
So that Table2 ends as:
But gives me all blank, not sure how to fix this.
Anyone that got an idea?
Solved! Go to Solution.
Hi @Anonymous
Try this for your calculated column in Table2:
LatestResult = VAR Latest_Time_ = CALCULATE ( MAX ( Table1[Time] ), FILTER ( ALL ( Table1[ID] ), Table1[ID] = Table2[ID] ) ) RETURN LOOKUPVALUE ( Table1[Result], Table1[ID], Table2[ID], Table1[Time], Latest_Time_ )
@Anonymous ,
You can also create a calculate column in table2 using DAX below:
Latest Result = VAR Current_ID = Table2[ID] VAR Max_Unix_Per_ID = CALCULATE(MAX(Table1[Unix]), FILTER(Table1, Table1[ID] = Current_ID)) RETURN CALCULATE(MAX(Table1[Result]), FILTER(Table1, Table1[Unix] = Max_Unix_Per_ID))
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
You can also create a calculate column in table2 using DAX below:
Latest Result = VAR Current_ID = Table2[ID] VAR Max_Unix_Per_ID = CALCULATE(MAX(Table1[Unix]), FILTER(Table1, Table1[ID] = Current_ID)) RETURN CALCULATE(MAX(Table1[Result]), FILTER(Table1, Table1[Unix] = Max_Unix_Per_ID))
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Try this for your calculated column in Table2:
LatestResult = VAR Latest_Time_ = CALCULATE ( MAX ( Table1[Time] ), FILTER ( ALL ( Table1[ID] ), Table1[ID] = Table2[ID] ) ) RETURN LOOKUPVALUE ( Table1[Result], Table1[ID], Table2[ID], Table1[Time], Latest_Time_ )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
101 | |
66 | |
48 | |
39 | |
34 |
User | Count |
---|---|
166 | |
112 | |
60 | |
56 | |
37 |