Forum Discussion
queryuser
4 years agoHelper I
If RANK result is not unique then RANK by Earliest Date
Hello, Can I ask for your help? How can I rank request that are similar in rank bu thave different submission times. (Earliest is priority) So there is a ranking in place for requests based o...
- 4 years ago
Hi,
I am not sure if I understood your question correctly, but if you are looking for creating a measure, please try the below. The first suggestion was creating a new column.
Desired Ranking measure: = VAR newtable = ADDCOLUMNS ( ALL ( Report_Complexity ), "@newrank", VAR timerank = CALCULATE ( RANKX ( ALL ( Report_Complexity ), CALCULATE ( MAX ( Report_Complexity[Submission Time] ) ), , ASC ) ) VAR ranking = CALCULATE ( IF ( SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "Low" && SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "High", 1, IF ( SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "High" && SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "High", 2, IF ( SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "Low" && SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "Low", 3, IF ( SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "High" && SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "Low", 4 ) ) ) ) ) RETURN timerank + ranking * 10000 ) RETURN IF ( HASONEVALUE ( Report_Complexity[Request] ), RANKX ( ALL ( Report_Complexity ), CALCULATE ( SUMX ( FILTER ( newtable, Report_Complexity[Request] = MAX ( Report_Complexity[Request] ) ), [@newrank] ) ), , ASC ) )
Jihwan_Kim
4 years agoSuper User
Hi,
I am not sure if I understood your question correctly, but if you are looking for creating a measure, please try the below. The first suggestion was creating a new column.
Desired Ranking measure: =
VAR newtable =
ADDCOLUMNS (
ALL ( Report_Complexity ),
"@newrank",
VAR timerank =
CALCULATE (
RANKX (
ALL ( Report_Complexity ),
CALCULATE ( MAX ( Report_Complexity[Submission Time] ) ),
,
ASC
)
)
VAR ranking =
CALCULATE (
IF (
SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "Low"
&& SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "High",
1,
IF (
SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "High"
&& SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "High",
2,
IF (
SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "Low"
&& SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "Low",
3,
IF (
SELECTEDVALUE ( Report_Complexity[Complexity Indicator] ) = "High"
&& SELECTEDVALUE ( Report_Complexity[Impact indicator] ) = "Low",
4
)
)
)
)
)
RETURN
timerank + ranking * 10000
)
RETURN
IF (
HASONEVALUE ( Report_Complexity[Request] ),
RANKX (
ALL ( Report_Complexity ),
CALCULATE (
SUMX (
FILTER (
newtable,
Report_Complexity[Request] = MAX ( Report_Complexity[Request] )
),
[@newrank]
)
),
,
ASC
)
)
queryuser
4 years agoHelper I
Hello,
Not very sure if it works but thanks a lot for the effort. Will accept as a solution.