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
apenaloz
Regular Visitor

El valor medio forma un filtro de columna de filtro por categorías

Así que tengo una tabla que tiene una columna con valores y otra con la categoría "Nacional" o "Internacional". ¡Necesito calcular el porcentaje promedio de los valores en la categoría nacional! Y sólo devolver el valor en % para que pueda verlo en una tarjeta.

Este es el tipo de datos que tengo

CategoríaValor
Nacional113,240,040
Importador106,828,146
Nacional97,134,688
Importador94,064,210
Importador90,575,333
Nacional35,319,980

Y la necesidad de devolver este visual

Need to get back this visualNecesidad de recuperar este visual

He hecho esto

National =CALCULATE(COUNTA('SEGUIMIENTO'[Category]),'SEGUIMIENTO'[Value] IN { "Nacional" })

%National =DIVIDE([National], COUNTA('SEGUIMIENTO'[Value]))

Pero no ajusta la respuesta correcta

1 ACCEPTED SOLUTION

I'm on a phone so sorry for the short answer, but change the countrows to sumx. You will need an extra argument:

%National =DIVIDE(SUMX(FILTER(ALL('SEGUIMIENTO'), 'SEGUIMIENTO'[Category] = "Nacional"),
'Seguimiento'[value]
)
,
SUMX(ALL('SEGUIMIENTO') , Seguimiento[value])
)

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

6 REPLIES 6
AllisonKennedy
Super User
Super User

Tratar:
%Nacional-DIVIDE(CALCULATE(COUNTROWS(FILTER(ALL('SEGUIMIENTO'), 'SEGUIMIENTO'[Category] á "Nacional"), CALCULATE(COUNTROWS(ALL('SEGUIMIENTO')
)

Puede reemplazar ALL por ALLSELECTED dependiendo de si desea que este porcentaje se actualice con selecciones de segmentación de datos.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hola Alison,
gracias por responder.
Pero la respuesta me da un porcentaje del 96% y debería ser 86 hay algo que power bi no me está entendiendo 😂. Lo necesito no para contar las filas, sino el porcentaje del dinero total. No sé si me entiendes. Si lo hago en un pastel me muestra la respuesta correcta.

Captura de pantalla 2020-09-20 123940.jpg

Pero, muy supervisor quiere verlo en una tarjeta.

I'm on a phone so sorry for the short answer, but change the countrows to sumx. You will need an extra argument:

%National =DIVIDE(SUMX(FILTER(ALL('SEGUIMIENTO'), 'SEGUIMIENTO'[Category] = "Nacional"),
'Seguimiento'[value]
)
,
SUMX(ALL('SEGUIMIENTO') , Seguimiento[value])
)

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Yeyy thank you.

Im new on this matter i've learned all by myself but at work i always find something more challenging stuff!

💌

¿Qué ha puesto en valores para ese gráfico circular?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

I have it in spanish but, 

  • In the legend space I have "category"
  • In the values space I have "Value or $"

Like you see in the image below

Captura de pantalla 2020-09-20 150004.jpg

 

 

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.