Forum Discussion
Anonymous
2 years agoNot applicable
Find next highest value
Hi there, I'm having trouble to find the next highest value in a column. In one table i have the actual zone and number of kilo's in a row. I need a calculated column (or by measure) to calcula...
- 2 years ago
Hi, Anonymous
You can try the following methods.
Table1:
Table2:
Column = Var _nexthighKG=CALCULATE(MIN(Table1[KG]),FILTER(Table1,[KG]>=EARLIER(Table2[KG])&&[Zone]=EARLIER(Table2[Zone]))) Return CALCULATE(MAX(Table1[Rate]),FILTER(Table1,[KG]=_nexthighKG&&[Zone]=EARLIER(Table2[Zone])))Is this the result you expect?
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, Anonymous
You can try the following methods.
Table1:
Table2:
Column =
Var _nexthighKG=CALCULATE(MIN(Table1[KG]),FILTER(Table1,[KG]>=EARLIER(Table2[KG])&&[Zone]=EARLIER(Table2[Zone])))
Return
CALCULATE(MAX(Table1[Rate]),FILTER(Table1,[KG]=_nexthighKG&&[Zone]=EARLIER(Table2[Zone])))
Is this the result you expect?
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.