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!View all the Fabric Data Days sessions on demand. View schedule
Hello everybody,
I'm looking for a DAX measure that calculates this :
Person Amount Week
1011 10$ 1
1011 15$ 2
1011 18$ 3
1011 11$ 4
1012 9$ 1
1012 7$ 2
1013 3$ 1
1013 4$ 2
1013 8$ 3
I need the SUM of Amounts of the last week of each person :
11$ + 7$ + 8$ = 26$
Any helps ?
Thank you
Solved! Go to Solution.
i'm not sure but try to add
1. new column
max_Week_by_Person = maxx(filter([TableName];earlier([Person])=[Person]);[Week])
2. new mesuare
sum_Amount_byLastWeek = sumx(filter(TableName;[Week]=[max_Week_by_Person]);[Amount])
mb someone knows best way to get it
Measure =
SUMX(
NATURALINNERJOIN(
Data,
ADDCOLUMNS(
VALUES( Data[Person] ),
"MaxWeek", CALCULATE( MAX( Data[Week] ) )
)
),
[Amount] * INT( [MaxWeek] = [Week] )
)an alternative approach
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @Anonymous,
By my tests, the formula from petrovnikitamai and LivioLanzo should solve your problem.
If you have solved your problem, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please feel free to ask.
Best Regards,
Cherry
Measure =
SUMX(
NATURALINNERJOIN(
Data,
ADDCOLUMNS(
VALUES( Data[Person] ),
"MaxWeek", CALCULATE( MAX( Data[Week] ) )
)
),
[Amount] * INT( [MaxWeek] = [Week] )
)an alternative approach
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
i'm not sure but try to add
1. new column
max_Week_by_Person = maxx(filter([TableName];earlier([Person])=[Person]);[Week])
2. new mesuare
sum_Amount_byLastWeek = sumx(filter(TableName;[Week]=[max_Week_by_Person]);[Amount])
mb someone knows best way to get it
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!