Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hola a todos,
Tengo un problema al usar la función de rango, pero creo que el problema es mi cerebro 😁
Tengo una tabla que contiene datos sobre alertas de servidores: en los detalles de estas alertas tengo el nombre de los equipos que enviaron la alerta.
# Ejemplo dado:
alerta 1 = > del equipo 1
alerta 2 = > del equipo 1
alerta 3 = > del equipo 2
alerta 4 = > del equipo 2
alerta 5 = > del equipo 2
alerta 6 = > del equipo 3
Me gustaría obtener el rango por equipo en función del número de alertas enviadas:
equipo 1 = > 2º
equipo 2 = > 1º
equipo 3 = > 3º
¿Cómo puedo hacerlo?
¡Gracias por su tiempo!
Solved! Go to Solution.
Hola, @Bruno_M
Solución dinámica como columna calculada:
Ranking =
var CurrentTeam = Ranking[Team]
var CountOfAlertsPerTeam = SUMMARIZE(Ranking, Ranking[Team], "AlertsCount", COUNTA(Ranking[Alerts]))
var AddRank = ADDCOLUMNS(CountOfAlertsPerTeam, "RankingTeams", RANKX(CountOfAlertsPerTeam, [AlertsCount], ,DESC, Dense), "Team_ForRanking", Ranking[Team])
var CurrentTeamFromRank = MAXX(FILTER(AddRank, CurrentTeam IN {[Team_ForRanking]}), [RankingTeams])
return CurrentTeamFromRank
Mi tabla de pruebas:
AlertsTeam
Alerta 1 | Equipo 1 |
Alerta 2 | Equipo 1 |
Alerta 3 | Equipo 4 |
Alerta 4 | Equipo 3 |
Alerta 5 | Equipo 6 |
Alerta 6 | Equipo 2 |
Alerta 7 | Equipo 2 |
Alerta 8 | Equipo 2 |
Alerta 9 | Equipo 3 |
Alerta 10 | Equipo 1 |
Alerta 11 | Equipo 3 |
Alerta 12 | Equipo 3 |
Alerta 13 | Equipo 3 |
Alerta 14 | Equipo 2 |
Hola, @Bruno_M
Solución dinámica como columna calculada:
Ranking =
var CurrentTeam = Ranking[Team]
var CountOfAlertsPerTeam = SUMMARIZE(Ranking, Ranking[Team], "AlertsCount", COUNTA(Ranking[Alerts]))
var AddRank = ADDCOLUMNS(CountOfAlertsPerTeam, "RankingTeams", RANKX(CountOfAlertsPerTeam, [AlertsCount], ,DESC, Dense), "Team_ForRanking", Ranking[Team])
var CurrentTeamFromRank = MAXX(FILTER(AddRank, CurrentTeam IN {[Team_ForRanking]}), [RankingTeams])
return CurrentTeamFromRank
Mi tabla de pruebas:
AlertsTeam
Alerta 1 | Equipo 1 |
Alerta 2 | Equipo 1 |
Alerta 3 | Equipo 4 |
Alerta 4 | Equipo 3 |
Alerta 5 | Equipo 6 |
Alerta 6 | Equipo 2 |
Alerta 7 | Equipo 2 |
Alerta 8 | Equipo 2 |
Alerta 9 | Equipo 3 |
Alerta 10 | Equipo 1 |
Alerta 11 | Equipo 3 |
Alerta 12 | Equipo 3 |
Alerta 13 | Equipo 3 |
Alerta 14 | Equipo 2 |
Hola, funciona bien gracias 😊
Hola @Bruno_M ,
Primero creé un equipo de tabla con solo una columna para tener cada equipo representado (seleccione crear una tabla):
Hi philouduv