Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
I've created a scoring model and everything worked out just fine. Until I realised I might have to score my variables differently. The score should be set on "AppNo"-level. Meaning the AmountDocs should be scored internally within each AppNo.
Today:
I have a table containing following information. If all ProductAppNo has different values in the AmountDocs field theres not a problem. It means that following result would occur:
ID | ID2 | AmountApproved | ScoringVariable |
2005 | 200501 | 1000 | 1 |
2005 | 200502 | 2000 | 2 |
2005 | 200503 | 3000 | 3 |
2005 | 200504 | 4000 | 4 |
2005 | 200505 | 5000 | 5 |
2005 | 200506 | 6000 | 6 |
2005 | 200507 | 7000 | 7 |
2005 | 200508 | 8000 | 8 |
2005 | 200509 | 10000 | 9 |
ALTHOUGH! When a TIE occurs, I receive following result:
AppNo | ProductAppNo | AmountDocs | ScoringVariable (calculated column) |
2005 | 200501 | 10000 | 2 |
2005 | 200502 | 10000 | 2 |
2005 | 200503 | 10000 | 2 |
2005 | 200504 | 9000 | 1 |
2005 | 200505 | 15000 | 3 |
2005 | 200506 | 10000 | 2 |
2005 | 200507 | 10000 | 2 |
2005 | 200508 | 10000 | 2 |
2005 | 200509 | 10000 | 2 |
DAX used to calculate the ScoringVariable = =RANKX(FILTER(DF;[AppNo]=EARLIER([AppNo]));[AmountDocs];;DESC;Dense)
Wanted result!:
ID | ID2 | AmountApproved | ScoringVariable | Calculation |
2005 | 200501 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200502 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200503 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200504 | 14000 | 8 | Distinct place 8 |
2005 | 200505 | 15000 | 9 | Distinct place 9 |
2005 | 200506 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200507 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200508 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
2005 | 200509 | 10000 | 4 | TIE between (1+2+3+4+5+6+7) / 7 |
Need help with how I should write my DAX-calculated column to achieve above result in the "ScoringVariable" according to the calculation mentioned in the "Calculation" column. Thank you very much for your help!
CJ
Solved it myself.
Hi @CJMolin,
Glad to hear that you have solved it by yourself. If possible, would you please kindly share your solution and mark it as an answer so that it can benefit more users having similar problem?
Regards,
Yuliana Gu
Any experts out there? 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
104 | |
69 | |
66 | |
55 | |
43 |
User | Count |
---|---|
157 | |
82 | |
65 | |
64 | |
61 |