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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
gcam032
Helper I
Helper I

Calcular dentro del % de grupo sobre xaxis

Hola a todos

No he encontrado la respuesta exacta en los foros que parece funcionar para lo que necesito.

Tengo un gráfico (ver imagen) donde el eje xaxis es una variable categórica (0, 100, 200, 300, 400.... 1000) grupos.

Mi valor es una suma.

Luego tengo una Leyenda del Mes del Año de una tabla Date Dim.

Lo que necesito es mostrar un %. Cada YearMonth % debe agregarse al 100% distribuido entre los valores categóricos. En otras palabras, una densidad de distribución para cada Mes de Año. Por lo tanto, las cifras brutas siguientes se normalizarán como una densidad y se mostrarán como %.

Screenshot 2020-03-30 at 16.44.27.png

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hola @gcam032 ,

1.Crear una tabla tenue:

dimdate = ADDCOLUMNS(CALENDARAUTO(),"YEARMONTH",YEAR([Date])*100+MONTH([Date]))

2.Crear una medida:

Measure = CALCULATE(SUM('Table'[value])) / CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Category]))

Finalmente verá:

Annotation 2020-03-31 152128.png

Para el archivo .pbxi relacionado, haga clic aquí.

Saludos
Kelly
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hola @gcam032 ,

1.Crear una tabla tenue:

dimdate = ADDCOLUMNS(CALENDARAUTO(),"YEARMONTH",YEAR([Date])*100+MONTH([Date]))

2.Crear una medida:

Measure = CALCULATE(SUM('Table'[value])) / CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Category]))

Finalmente verá:

Annotation 2020-03-31 152128.png

Para el archivo .pbxi relacionado, haga clic aquí.

Saludos
Kelly
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!

Hola Kelly,

Gracias por proporcionar su solución. Está cerca, pero necesito un cálculo un poco diferente, ¿puedes ayudar?

En su ejemplo, teniendo en cuenta el púrpura, los porcentajes deben ser:

11% (11)

56% (56)

34% (34)

Suma al 100%

Rosa sería:

13% (8)

53% (34)

34% (22)

Suma al 100%

¿Tiene sentido? Es dentro de las densidades de grupo, donde un grupo - YEARMONTH

Después de un poco de prueba y error- Me di cuenta de que tenía que incluir los otros filtros que había aplicado al gráfico. ¡Tu solución estaba en el punto de ver! ¡Gracias!

Hola

Comparte el enlace desde donde puedo descargar tu archivo PBI.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

¿Dividir por 100? Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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