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.
Hello,
Can we get a reverse percent of Column total in the below table..I know its a little weird requirement 😞
Output should be
Name | OverallTest | Percent column of total |
A | 53 | 0.00% |
B | 53 | 1.68% |
C | 32 | 10.06% |
D | 20 | 11.17% |
E | 18 | 17.88% |
F | 3 | 29.61% |
G | 0 | 29.61% |
Total | 179 | 100% |
Solved! Go to Solution.
@AlexisOlson - I have scenario where in I need to distribute a value across these 7 people..where in person with highest "Overalltest" should get small chunk and lowest "Overalltest" should get big chunk.
Thanks.
This is annoyingly tricky since you need to tie-break the rankings.
My basic approach to this would be to define a ReverseName measure that returns the name from a reverse ranking and then use that in any measure that you want to calculate the "reverse" for.
ReverseName =
VAR _Names = ALLSELECTED ( Table1[Name] )
VAR _NameCount = COUNTROWS ( _Names )
VAR _CurrName = SELECTEDVALUE ( Table1[Name] )
VAR _Ranks =
ADDCOLUMNS (
_Names,
"@RankName", RANKX ( _Names, [Name],, ASC ),
"@RankVal", RANKX ( _Names, CALCULATE ( SUM ( Table1[OverallTest] ) ) )
)
VAR _AscDesc =
ADDCOLUMNS (
_Ranks,
"@ASC", RANKX ( _Ranks, _NameCount * [@RankVal] + [@RankName],, ASC ),
"@DESC", RANKX ( _Ranks, _NameCount * [@RankVal] + [@RankName],, DESC )
)
VAR _AscRank =
MAXX ( FILTER ( _AscDesc, [Name] = _CurrName ), [@ASC] )
RETURN
MAXX ( FILTER ( _AscDesc, [@DESC] = _AscRank ), [Name] )
Then PercentReverse can be defined as
PercentInverse =
VAR _Name = [ReverseName]
RETURN
CALCULATE ( [Percent], Table1[Name] = _Name )
This should work for whatever measure you want to use instead of [Percent].
It should be possible but it would help if you can explain why you're trying to do this.
@AlexisOlson - I have scenario where in I need to distribute a value across these 7 people..where in person with highest "Overalltest" should get small chunk and lowest "Overalltest" should get big chunk.
Thanks.
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 |
---|---|
103 | |
101 | |
76 | |
66 | |
60 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |