Forum Discussion
AuroraNI
5 years agoHelper III
difference based on dynamic rank
Hi, I have the below table in PBI and I would like another column in this table that calculates the time differences between 1st place and all the other runners, and this would change based on the e...
- 5 years ago
V-lianl-msft
5 years agoCommunity Support
Hi AuroraNI ,
Create a calculated column as "dynamic rank"
rank = RANKX(FILTER('Table',EARLIER('Table'[event])='Table'[event]),'Table'[time],,ASC)Then create a measure like this:
Measure = var _rank = SELECTEDVALUE('Table'[rank])
var _event = SELECTEDVALUE('Table'[event])
var diff = CALCULATE(MAX('Table'[time]),FILTER(ALL('Table'),'Table'[rank]=_rank-1&&'Table'[event]=_event))
var current_ = MAX('Table'[time])
return IF(ISBLANK(diff),0,current_-diff)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.