Forum Discussion
davidap
2 years agoAdvocate I
DAX Retrieve value from another row and column within table based on matching criteria
Problem New Column Aggregate ID should return the Index ID where the User matches and Paid Date is between the First and Last Service dates of an Index ID. The Index ID marks a major event with Aggr...
- 2 years ago
Hi, davidap
You can try the following methods.
Aggregate ID = CALCULATE ( MAX ( 'Table'[Index ID] ), FILTER (ALLEXCEPT( 'Table','Table'[User]), [Paid Date] >= 'Table'[First Service] && [Paid Date] <= 'Table'[Last Service] ) )Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
2 years agoCommunity Support
Hi, davidap
You can try the following methods.
Aggregate ID =
CALCULATE ( MAX ( 'Table'[Index ID] ),
FILTER (ALLEXCEPT( 'Table','Table'[User]),
[Paid Date] >= 'Table'[First Service]
&& [Paid Date] <= 'Table'[Last Service]
)
)
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
davidap
2 years agoAdvocate I
This was closest to what I used in the end. I added a column determine whether the Index had the max $ amount to break ties.