Forum Discussion
Get Second highest value
I have following tables
Build table with Code Coverage
Mapping table - Work Item ID & Build ID
And Work Item table
Now, I have a measure that gives me the latest Build ID (from that second table of Build ID & Work Item ID)
And with that I am fetching relevant Build Repo & Code Coverage in that third table
Hence in the third table as shown above, I am getting the latest Code Coverage against the work item & repo.
Now, what I need is, to get the previous Code Coverage in that third table shown above.
For that I need a measure in this third table, to get the second highest 'build ID' from the build table (First Table), for that respective 'Build Repo' column value in the Third table.
How can I use Lookup to do that?
Hi,
You can create a measure with the following logic:
Start data:
Dax:Second latest build =var latest = MAX('Matrix example'[Company]) returnCALCULATE(MAX('Matrix example'[Company]),'Matrix example'[Company]<>latest) //Exclude the latest from MAXEnd result:I hope this helps and if it does consider accepting this as a solutio nand giving the post a thumbs up!
3 Replies
- ValtteriNCommunity Champion
Hi,
You can create a measure with the following logic:
Start data:
Dax:Second latest build =var latest = MAX('Matrix example'[Company]) returnCALCULATE(MAX('Matrix example'[Company]),'Matrix example'[Company]<>latest) //Exclude the latest from MAXEnd result:I hope this helps and if it does consider accepting this as a solutio nand giving the post a thumbs up!
- CQueenFrequent Visitor
I kept getting True/False errors with this solution