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! Get ahead of the game and start preparing now! Learn more
I found this question in Stack Overflow but it was for SQL query. I would like to know how this can be done in DAX.
It should be a measure as it should dynamically (should work on filtered data too) select the minimum date for each group (ID) and sum the values (WEIGHT) corresponding to it.
Thanks for the Help. 🙂
Hi @NirmalRayan
Try the below.
Measure =
SUMX(
SUMMARIZE( 'Table', 'Table'[ID], 'Table'[DATE] ),
VAR __minDate =
CALCULATE(
MIN( 'Table'[DATE] ),
ALL( 'Table'[DATE] )
)
RETURN
IF(
__minDate = 'Table'[DATE],
CALCULATE(
SUM( 'Table'[weight] ),
'Table'[DATE] = __minDate
)
)
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 20 | |
| 12 | |
| 10 |