Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello everyone! I'm tryng to select a value based on another column of the same table. In this table, I have a lot of user's IDs, and I have different weights and dates for some users. In this case, I want to return the weight related with the min date, for each user.
For example:
user_id | weight | date |
1 | 80.5 | 01/06/2020 |
1 | 81.3 | 10/09/2020 |
1 | 80 | 20/12/2020 |
Based on this table, I'd like to return just the value '80.5', because for this user, this is the weight with the minimum date.
Please, could anyone help me make this happen with DAX?
Thanks in advance!
Hi,
You may download my PBI file from here.
Hope this helps.
Hi, @marloswn
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Result =
var mindate =
CALCULATE(
MIN('Table'[Date]),
ALLEXCEPT('Table','Table'[User_id])
)
return
CALCULATE(
SUM('Table'[Weight]),
FILTER(
ALLEXCEPT('Table','Table'[User_id]),
[Date]=mindate
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-alq-msft , but, in this case, I want just de 'weight' column, not user_id. And, as I mentioned, the logic is breaking when it finds an duplicate data. Is there any solution for this?
Hi, @marloswn
You may try the following measure. The pbix file is attached in the end.
Measure =
CALCULATE(
SUM('Table'[Weight]),
FILTER(
ALL('Table'),
[Date]=
CALCULATE(
MIN('Table'[Date]),
ALL('Table')
)
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Guys, I almost managed to reach a solution:
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.