Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi, All.
Can you help me with this?
I have this kind of table that consist of location, item, status, score, & target.
1Score2: =
Here is my expected Result:
Cases:
If the Status is "NEGATIVE" or "LOW", the Rank must start in the lowest value.
If the Status is "NORMAL" or HIGH, the Rank must start in the highest value.
See Examples Below:
Thanks in Advance.
Please refer to this link for my sample files:
https://drive.google.com/drive/folders/1jDjGSM9fxMoXg3hxIiNIaQQRbBb54Euj
Solved! Go to Solution.
Hi, @Nnamarie_1997
If you need to rank by measure [1Score2: ],please try measure like:
Rank(1Score2) =
VAR tab =
ADDCOLUMNS (
SUMMARIZE (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[LOCATION] = MAX ( 'Table'[LOCATION] )
&& 'Table'[STATUS] = MAX ( 'Table'[STATUS] )
),
'Table'[LOCATION],
'Table'[ITEM],
'Table'[STATUS]
),
"@1Score2", [1Score2:]
)
VAR CurrentValue = [1Score2:]
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Table'[STATUS] ) IN { "NEGATIVE", "LOW" }, RANKX ( tab, [@1Score2], CurrentValue, ASC, DENSE ),
SELECTEDVALUE ( 'Table'[STATUS] ) IN { "Normal", "High" }, RANKX ( tab, [@1Score2], CurrentValue, DESC, DENSE )
)
If you need to rank by field Table[SCORE],try measure like:
Rank(score) =
VAR tab =
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[LOCATION] = MAX ( 'Table'[LOCATION] )
&& 'Table'[STATUS] = MAX ( 'Table'[STATUS] )
)
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE( 'Table'[STATUS] ) IN { "NEGATIVE", "LOW" }, RANKX ( tab, CALCULATE ( MAX ( 'Table'[SCORE] ) ),, ASC, DENSE ),
SELECTEDVALUE('Table'[STATUS] ) IN { "Normal", "High" }, RANKX ( tab, CALCULATE ( MAX ( 'Table'[SCORE] ) ),, DESC, DENSE )
)
Best Regards,
Community Support Team _ Eason
Hi, @Nnamarie_1997
Not quite understand what you mean. From your formula, the value of rank should depend on the value of [1Score2:].
What is your expected result?
Best Regards,
Community Support Team _ Eason
Hi @v-easonf-msft ,
Sorry for Late Reply.
Here is my expected result.
Cases:
If the Status is "NEGATIVE" or "LOW", the Rank must start in the lowest value.
If the Status is "NORMAL" or HIGH, the Rank must start in the highest value.
See Examples Below:
Thank You..
Hi, @Nnamarie_1997
If you need to rank by measure [1Score2: ],please try measure like:
Rank(1Score2) =
VAR tab =
ADDCOLUMNS (
SUMMARIZE (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[LOCATION] = MAX ( 'Table'[LOCATION] )
&& 'Table'[STATUS] = MAX ( 'Table'[STATUS] )
),
'Table'[LOCATION],
'Table'[ITEM],
'Table'[STATUS]
),
"@1Score2", [1Score2:]
)
VAR CurrentValue = [1Score2:]
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Table'[STATUS] ) IN { "NEGATIVE", "LOW" }, RANKX ( tab, [@1Score2], CurrentValue, ASC, DENSE ),
SELECTEDVALUE ( 'Table'[STATUS] ) IN { "Normal", "High" }, RANKX ( tab, [@1Score2], CurrentValue, DESC, DENSE )
)
If you need to rank by field Table[SCORE],try measure like:
Rank(score) =
VAR tab =
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[LOCATION] = MAX ( 'Table'[LOCATION] )
&& 'Table'[STATUS] = MAX ( 'Table'[STATUS] )
)
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE( 'Table'[STATUS] ) IN { "NEGATIVE", "LOW" }, RANKX ( tab, CALCULATE ( MAX ( 'Table'[SCORE] ) ),, ASC, DENSE ),
SELECTEDVALUE('Table'[STATUS] ) IN { "Normal", "High" }, RANKX ( tab, CALCULATE ( MAX ( 'Table'[SCORE] ) ),, DESC, DENSE )
)
Best Regards,
Community Support Team _ Eason
User | Count |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |