Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |