Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Cubos de recuento discretos basados en promedios

Intento clasificar a los alumnos en función de los promedios de puntuación en Power BI, pero me he metido en muchos problemas. Me gustaría poder clasificar los promedios en cubos dependiendo de los filtros que se aplican a la fecha a través de segmentaciones de datos. Por ejemplo, si filtro en dos meses me gustaría que los resultados se en cubos en función del promedio de los dos meses.

Aquí está una muestra de los datos que voy a utilizar:

Puntuación de fecha   Categoría del estudiante
Ene-20  0.8     Jim por     encima del 80
Feb-20  0.75    Jim Abajo     80
Mar-20  0.7     Jim Por debajo de     80
Ene-21 0.85 Jim Por encima del 80 feb-21 0.60 Jim Por debajo de 80 Mar-21 0.79 Jim Por debajo 80 Ene-20 0.9 Andrea Por encima del 80 Feb-20 0..0.0.0 95 Andrea Por encima de 80 Mar-20 0.92 Andrea Por encima 80 Ene-20 0.6 Max Por debajo de 80 Feb-20 0.65 Max Por debajo de 80 Mar-20 0.7 Max Por debajo de 80

Me gustaría poder mostrar cuántos estudiantes caen en los 80 y por debajo de 80 cuadros de mandos dependiendo del filtro que elija. Por ejemplo, si me filtraba en enero y feb 2020, mostraría 2 estudiantes menores de 80 y 1 estudiante por encima de 80. Si sólo me filtrara en enero de 2020, mostraría 2 estudiantes por encima de 80 y 1 por debajo de 80.

Pude crear una solución que solo funciona durante un año usando SUMMARIZECOLUMNS y luego haciendo un recuento filtrado de estas columnas, sin embargo esto se descompone una vez que tengo más de un año.

Puntuaciones superiores a 80o
COUNTROWS(
FILTRO(
COLUMNAS RESUMIDAS(
'Mesa'[Estudiante],
'Tabla'[Fecha de la llamada]. [Año],
"Avg Score", AVERAGE('Table'[Score])
),[Puntuación media]>0.80
))
Si elimino la columna de tiempo, no interactúa correctamente con las segmentaciones y sigue rompiendo

Puntuaciones superiores a 80o
COUNTROWS(
FILTRO(
COLUMNAS RESUMIDAS(
'Mesa'[Estudiante],
"Promedio",PROMEDIO('Tabla'[Puntuación])
),[Promedio] > 0,80
))
Tal vez hay una manera mucho más fácil de abordar esto, pero estoy atascado con mi respuesta. Cualquier ayuda sería muy apreciada
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@matthew_d solución adjunta, hay algunas otras tablas en el modelo, simplemente ignore esas. Mira la tabla de puntuación y fecha.

También en los datos de muestra, utilicé el año 2021 en lugar de 2020, pero la lógica es la misma.

Consulta mi última entrada de blog Año-2020, Pandemia, Power BI y más allá para obtener un resumen de mis versiones favoritas de las características de Power BI en 2020

Me gustaría elogios si mi solución ayudara. 👉 Si puedes dedicar tiempo a publicar la pregunta, también puedes hacer esfuerzos para dar Felicitaciones a quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@matthew_d Sí, me gusta usar variables siempre que sea posible, especialmente valores estáticos, es fácil cambiar en caso de que desee reemplazarlo en lugar de realizar los cambios en el DAX. Si desea llevarlo al siguiente nivel, puede usar fácilmente el parámetro what-if y cambiar el valor de esta variable con el valor what-if y todo debería funcionar.

Siempre busco código escalable y fácil de administrar.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Gracias @parry2k ! El uso de una variable para la comparación funcionó muy bien!

Publicación del Dax para cualquier persona que tenga curiosidad:

Puntuaciones superiores a 80o
VAR _above 0,8
devolución
SUMX(
RESUMEN(
VALUES('Tabla'[Estudiante]),
'Mesa'[Estudiante],
"__avg", AVERAGE( 'Tabla'[Puntuación])
),
IF ( [__avg] > _above, 1)
)
parry2k
Super User
Super User

@matthew_d solución adjunta, hay algunas otras tablas en el modelo, simplemente ignore esas. Mira la tabla de puntuación y fecha.

También en los datos de muestra, utilicé el año 2021 en lugar de 2020, pero la lógica es la misma.

Consulta mi última entrada de blog Año-2020, Pandemia, Power BI y más allá para obtener un resumen de mis versiones favoritas de las características de Power BI en 2020

Me gustaría elogios si mi solución ayudara. 👉 Si puedes dedicar tiempo a publicar la pregunta, también puedes hacer esfuerzos para dar Felicitaciones a quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@matthew_d gotch te lo atrapará pronto.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

m3tr01d
Continued Contributor
Continued Contributor

@matthew_d
Puede probar esta medida en su lugar

Scores Above 80 = 
COUNTROWS(
    FILTER(
        VALUES( 'Data'[Student] ),
        CALCULATE( AVERAGE( Data[Score] ) ) > 0.8
    )
)
Anonymous
Not applicable

Gracias @m3tr01d creo que el desafío es que necesito algún tipo de conteo distinto. Originalmente tenía algo similar a tu sugerencia, pero tiende a contar demasiado a los estudiantes. Apreciar la sugerencia

parry2k
Super User
Super User

@matthew_d Sí eliminar el tiempo romperá la segmentación, pero permítanme entender primero sus datos. la puntuación es una columna o una medida?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

h I @parry2k pena por no ser más claro. Estoy tratando de crear una medida que calcule los recuentos distintos que pertenecen a los cortes de puntuación. Tengo la columna en mi tabla actual que tiene una puntuación para cada prueba (lo que puede suceder en varios intervalos de tiempo), y quiero que la medida interactúe dinámicamente con los intervalos de tiempo seleccionados por el usuario.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors