Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
My data has the following structure:
Account | Exposure | Credit Rating |
ABC | 22M | 25% |
CatDog | 21M | 14% |
Elephant | 30M | 14% |
Dinosaur | 28M | 8% |
Spider | 18M | 8% |
I want a rank measure that uses both credit rating and exposure, and also filtering on exposure >
In this example, the ranks would be:
Account | Rank |
ABC | 1 |
CatDog | 3 |
Elephant | 2 |
Dinosaur | 4 |
Spider | (blank) |
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated column.
Rank_ex =
IF(
'RankTable'[Exposure]>=20000000,
RANKX('RankTable','RankTable'[Exposure],,ASC),BLANK())
Rank_cre =
IF(
'RankTable'[Exposure]>=20000000,
RANKX('RankTable','RankTable'[Credit Rating],,ASC),BLANK())
Ranx3 =
'RankTable'[Rank_ex]+'RankTable'[Rank_cre]+'RankTable'[Rank_cre]
2. Create measure.
Rank =
IF(
MAX('RankTable'[Ranx3])=BLANK(),BLANK(),
RANKX(ALL('RankTable'),CALCULATE(SUM('RankTable'[Ranx3])),,DESC))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated column.
Rank_ex =
IF(
'RankTable'[Exposure]>=20000000,
RANKX('RankTable','RankTable'[Exposure],,ASC),BLANK())
Rank_cre =
IF(
'RankTable'[Exposure]>=20000000,
RANKX('RankTable','RankTable'[Credit Rating],,ASC),BLANK())
Ranx3 =
'RankTable'[Rank_ex]+'RankTable'[Rank_cre]+'RankTable'[Rank_cre]
2. Create measure.
Rank =
IF(
MAX('RankTable'[Ranx3])=BLANK(),BLANK(),
RANKX(ALL('RankTable'),CALCULATE(SUM('RankTable'[Ranx3])),,DESC))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @iab_pbi
Refer to this article: https://www.sqlbi.com/articles/rankx-on-multiple-columns-with-dax-and-power-bi/
Another way to achieve what you're after is by doing the following calculated column:
Ranking = RANKX ( ALLSELECTED ( 'Table'[Account] ) , CALCULATE ( SUM ( 'Table'[Exposure] ) - ( SUM ( 'Table'[Exposure] ) * SUM ( 'Table'[Credit Rating] ) )
I've basically applied the logic that the Exposure Amount less the risk factor associated with the Credit Rating (i.e. Risk Factor = Exposure Amount - ( Exposure Amount * Credit Rating ). You can modify how you prefer.
All the best.
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
I tried that suggestion but it didn't work. If I use this formula, I get the right accounts showing up, but I need to also add in ranking by exposure.
User | Count |
---|---|
123 | |
76 | |
62 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |