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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JavierGalán
Regular Visitor

CALCULAR MODA (VALOR MÁS REPETIDO) en POWER BI

Hola a todos, estoy analizando un dataset "Encuestas", de encuestas anuales a clientes. Cada cliente tiene varias respuestas al año y en cada encuesta puede valorar el campo "Nivel de satisfacción" como: Muy satisfecho, normal, Nada satisfecho.

 

Me gustaría sacar la MODA (Valor más repetido global y anual) de "Nivel de satisfacción". Pero no sé cómo hacerlo en Power BI (DAX). 

¿Y si los valores son numéricos (ejemplo: 1, 2, 3)? ¿Cómo se realizaría la operación?

 

Muchas gracias!!!!

8 REPLIES 8
nexus150
Frequent Visitor

Hola Javier, prueba con esta formula, te debe servir, te va a dar la moda en el contexto que estes evaluando, si la quieres globla solo cambia tabla en el summarizr por ALL(Tabla).

 

moda =
var grupos = SUMMARIZE(Tabla, Tabla[CampoModa] , "Total" , COUNTROWS(Tabla) )
var maximo = MAXX(grupos , [total])
var modas = filter(grupos, [total] = maximo)
return
CONCATENATEX(modas, [CampoModa] , "/" )

Hola nexus150, me pudieras ayudar con un print screen o pantallazo en power bi de la fórmula que propones, por favor. Gracias!

Hola jibranez, esta es la formula

moda =
var grupos = SUMMARIZE(Tabla, Tabla[CampoModa] , "Total" , COUNTROWS(Tabla) )
var maximo = MAXX(grupos , [total])
var modas = filter(grupos, [total] = maximo)
return
CONCATENATEX(modas, [CampoModa] , "/" )

Estaba buscando la solución a esta duda y me la resolvió perfectamente. Muchas gracías!

v-lili6-msft
Community Support
Community Support

hola @JavierGalán

Creo que podrías crear una medida para conseguirlo.

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-measures

¿Cuál es la salida esperada para los datos de muestra (FASHION (Global and Annual Repeater Value)))?

Por favor, consulte esta publicación sobre cómo obtener respuesta a su pregunta rápidamente:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@JavierGalán ,La información que ha proporcionado no está despejar el problema para mí. Por favor, puede explicar con un ejemplo.
¿Puede compartir datos de ejemplo y salida de ejemplo en formato de tabla?
Apreciamos tus Felicitaciones.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

 

JavierGalán_0-1598957528444.png

 

Los datos los estás importando desde Excel (por la visualización de la tabla) ¿Porqué no hacer el cálculo de la Moda previamente en Excel, y utilizarlo en PowerBI?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors