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
Fair-UL
Helper II
Helper II

Crear un pareto de porcentaje de defecto por categoría

¿Puede alguien ayudar con el DAX adecuado para resolver esto.

Tengo estos datos

Proyecto #tipo de defectoQty
1a3
1b1
1c1
1a2
1a1
1a1
1b2
2a1
2b1
2b1
2b2
2c1
2a3
2c1
2a1
2c1

Necesito crear un gráfico de barras apiladas para mostrar el porcentaje de defecto por categoría a,b,c por cada proyecto. Usé Dax y me da en el gráfico de barras apiladas 100% todo el tiempo. No puedo permitir que considere el denimador como el número total de instancias por proyecto 1 o 2.

Lo hice en excel para la simplificación. Usé pivote para contar #defects por cantidad por cada tipo de defecto y dividido sobre la suma total de

a7
b3
c1
a5
b4
c3

esto es lo que quiero graficar (puedo usar la barra apilada en pbi)

proyecto 1proyecto 2
a64%42%
b27%33%
c9%25%

Capture.JPG

Agradezco la ayuda

1 ACCEPTED SOLUTION

@Fair-UL aquí está la medida

% = DIVIDE ( SUM ( 'Table'[qty] ), CALCULATE ( SUM ( 'Table'[qty] ), ALLEXCEPT ( 'Table', 'Table'[project#] ) ) )

aquí está la salida

image.png

aquí es cómo lo haces

image.png

Me 💖 Kudos 🙂 si mi solución me ayudara. Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



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

4 REPLIES 4
amitchandak
Super User
Super User

Trate como

divide(sum(Table[Qty]),calculate(sum(Table[Qty]),allexcept(Table[defect type])))

Usé este mismo dax antes, pero con Count y ALL, no era correcto

ahora utilicé el suyo, pero cambié el ALLEXCEPT a ALL y me dio el gráfico que necesito. Muchas gracias @amitchandak

@Fair-UL aquí está la medida

% = DIVIDE ( SUM ( 'Table'[qty] ), CALCULATE ( SUM ( 'Table'[qty] ), ALLEXCEPT ( 'Table', 'Table'[project#] ) ) )

aquí está la salida

image.png

aquí es cómo lo haces

image.png

Me 💖 Kudos 🙂 si mi solución me ayudara. Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



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.

Gracias @parry2k utilicé el mismo DAX con ALL no ALLEXCEPT, ya que tenía varios desgloses de capas en el gráfico de barras apiladas y usé todas esas columnas para desfiltrar el denominador. Gracias de nuevo, los gráficos son geniales!

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.