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.
Hola
Estamos tratando de averiguar la mejor manera de mostrar cuántos miembros del personal diferentes fueron asignados a un cliente en particular durante un período de tiempo, y qué porcentaje de esas asignaciones fueron realizadas por los principales miembros del personal X (en términos de conteo).
En la práctica nos gustaría poder decir "Joan Smith tenía 20 citas, y el 75% de ellos fueron asignados a 3 miembros del personal", y en última instancia "el 90% de nuestros clientes tenían al menos el 75% de sus nombramientos asignados a 3 miembros del personal".
Esto nos ayudará a asegurarnos de que los clientes están viendo las mismas caras, y construir buenas relaciones mientras los miembros del personal obtienen "conocimiento especializado".
¿Puedo obtener algunos consejos sobre cómo crear una medida que la calcule para los 3 o 4 miembros del personal principales (es decir, los valores 3 y 4 que se están fijando), y si es posible hacer de este valor una variable que puede seleccionar de una lista o entrar en el informe. Gracias de nuevo por todas sus entradas!!
Los datos se parecen un poco a esto:
Personal | Cliente | Fecha | Hora |
Staff1 | Joan Smith | 01/09/2020 | 10:00 |
Staff2 | Joan Smith | 01/09/2020 | 19:00 |
Staff1 | Joan Smith | 02/09/2020 | 10:00 |
Staff3 | Joan Smith | 02/09/2020 | 19:00 |
Staff1 | Joan Smith | 03/09/2020 | 10:00 |
Staff4 | Joan Smith | 03/09/2020 | 19:00 |
Staff1 | Joan Smith | 04/09/2020 | 10:00 |
Staff5 | Joan Smith | 04/09/2020 | 19:00 |
Staff1 | Joan Smith | 05/09/2020 | 10:00 |
Staff6 | Joan Smith | 05/09/2020 | 19:00 |
Staff1 | Joan Smith | 06/09/2020 | 10:00 |
Staff2 | Joan Smith | 06/09/2020 | 19:00 |
Staff1 | Joan Smith | 07/09/2020 | 10:00 |
Staff2 | Joan Smith | 07/09/2020 | 19:00 |
Staff1 | Joan Smith | 08/09/2020 | 10:00 |
Staff3 | Joan Smith | 08/09/2020 | 19:00 |
Staff1 | Joan Smith | 09/09/2020 | 10:00 |
Staff4 | Joan Smith | 09/09/2020 | 19:00 |
Staff1 | Joan Smith | 10/09/2020 | 10:00 |
Staff5 | Joan Smith | 10/09/2020 | 19:00 |
Staff1 | John Smith | 01/09/2020 | 08:00 |
Staff1 | John Smith | 01/09/2020 | 17:00 |
Staff3 | John Smith | 02/09/2020 | 08:00 |
Staff1 | John Smith | 02/09/2020 | 17:00 |
Staff4 | John Smith | 03/09/2020 | 08:00 |
Staff1 | John Smith | 03/09/2020 | 17:00 |
Staff5 | John Smith | 04/09/2020 | 08:00 |
Staff1 | John Smith | 04/09/2020 | 17:00 |
Staff6 | John Smith | 05/09/2020 | 08:00 |
Staff2 | John Smith | 05/09/2020 | 17:00 |
Staff7 | John Smith | 06/09/2020 | 08:00 |
Staff2 | John Smith | 06/09/2020 | 17:00 |
Staff8 | John Smith | 07/09/2020 | 08:00 |
Staff2 | John Smith | 07/09/2020 | 17:00 |
Staff9 | John Smith | 08/09/2020 | 08:00 |
Staff1 | John Smith | 08/09/2020 | 17:00 |
Staff10 | John Smith | 09/09/2020 | 08:00 |
Staff1 | John Smith | 09/09/2020 | 17:00 |
Staff11 | John Smith | 10/09/2020 | 08:00 |
Staff2 | John Smith | 10/09/2020 | 17:00 |
Solved! Go to Solution.
@redhughes, 🙂 seguro
En lugar de usar TOPN, podemos usar RANKX en su lugar, y ajustar el rango basado en [Recuento de citas] para incluir un desempate basado en el nombre del pentagrama.
Appointment Count Top N Staff =
VAR N = [Top Staff Value]
VAR StaffCount = [Staff Count]
RETURN
IF (
N <= StaffCount,
// For each Staff member
// calculate @RankAdjustment which is the rank of the Staff name
// divided by StaffCount + 1.
// This is used to break ties when ranking Appointment Count.
VAR Staff =
ADDCOLUMNS (
VALUES ( Appointments[Staff] ),
"@RankAdjustment",
DIVIDE (
RANKX ( VALUES ( Appointments[Staff] ), Appointments[Staff] ),
StaffCount + 1
)
)
VAR TopStaff =
FILTER (
Staff,
RANKX ( Staff, RANKX ( Staff, [Appointment Count],, ASC ) + [@RankAdjustment] ) <= N
)
RETURN
CALCULATE ( [Appointment Count], TopStaff )
)
PBIX conectado con la medida ajustada.
saludos
Owen
Hola
En los datos que ha compartido, muestre el resultado esperado muy claramente.
Hola
Así es como lo abordaría como punto de partida (PBIX adjunto):
Top Staff = GENERATESERIES(0, DISTINCTCOUNT ( Appointments[Staff] ), 1)
Staff Count =
DISTINCTCOUNT ( Appointments[Staff] )
Appointment Count =
COUNTROWS ( Appointments )
Appointment Count Top N Staff =
VAR N =
[Top Staff Value]
VAR StaffCount =
[Staff Count]
RETURN
IF (
N <= StaffCount,
VAR TopStaff =
TOPN (
N,
VALUES ( Appointments[Staff] ),
[Appointment Count]
)
RETURN
CALCULATE (
[Appointment Count],
TopStaff
)
)
Appointment % Top N Staff =
DIVIDE (
[Appointment Count Top N Staff],
[Appointment Count]
)
saludos
Owen
@OwenAuger Eso es genial, gracias. ¿Cómo tendría que ajustar los argumentos TOPN para cambiar el comportamiento de los valores vinculados? En este caso, preferiríamos que las puntuaciones % de Joan Smith fueran:
Top N | % |
1 | 50% |
2 | 65% |
3 | 75% |
4 | 85% |
5 | 95% |
6 | 100% |
en lugar del 95% desde 3 Top N hacia arriba.
Hola @redhughes ,
OwenAuger ha proporcionado una buena solución, y también puede referirse a la siguiente medida:
appointments by topn staff =
VAR N =
MAX ( 'topn'[Value] )
RETURN
SUMX (
TOPN (
N,
SUMMARIZE (
'Table',
'Table'[Staff],
"appointments by staff", COUNTROWS ( 'Table' ),
"break ties", SUMX ( 'Table', VALUE ( 'Table'[Date] ) )
),
[appointments by staff] + [break ties]
),
[appointments by staff]
)
Para obtener más información, consulte el archivo pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EQQoTZUt7KlHoj7Cl3...
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Saludos
Dedmon Dai
@redhughes, 🙂 seguro
En lugar de usar TOPN, podemos usar RANKX en su lugar, y ajustar el rango basado en [Recuento de citas] para incluir un desempate basado en el nombre del pentagrama.
Appointment Count Top N Staff =
VAR N = [Top Staff Value]
VAR StaffCount = [Staff Count]
RETURN
IF (
N <= StaffCount,
// For each Staff member
// calculate @RankAdjustment which is the rank of the Staff name
// divided by StaffCount + 1.
// This is used to break ties when ranking Appointment Count.
VAR Staff =
ADDCOLUMNS (
VALUES ( Appointments[Staff] ),
"@RankAdjustment",
DIVIDE (
RANKX ( VALUES ( Appointments[Staff] ), Appointments[Staff] ),
StaffCount + 1
)
)
VAR TopStaff =
FILTER (
Staff,
RANKX ( Staff, RANKX ( Staff, [Appointment Count],, ASC ) + [@RankAdjustment] ) <= N
)
RETURN
CALCULATE ( [Appointment Count], TopStaff )
)
PBIX conectado con la medida ajustada.
saludos
Owen
@OwenAuger - gracias de nuevo por la respuesta rápida! sólo una pregunta rápida, ¿cuál es la importancia de la declaración IF (es decir, N <- StaffCount)? digamos que un cliente tiene 7 citas y todos están con sólo 2 de nuestros miembros del personal, entonces tendría sentido que su "medida de continuidad" debe ser 100% en top Staff 3 pero debido a esa declaración IF, su medida está en blanco.
@redhughes buen punto - que era principalmente para el gráfico, ya que pensé que se veía mejor cuando el porcentaje acumulado terminó en el número total de personal.
Sin embargo, en general puedo ver que no desea dejar de en blanco, por lo que puede eliminar el IF si lo desea.
Usted podría tener dos versiones de la medida con y sin el IF si es necesario.
saludos
Owen
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |