cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Porcentaje del total de cada elemento de leyenda

Estoy usando una visualización de línea con varios valores de leyenda. Quiero mostrar leyendas como un porcentaje del total por mes.

Ahora cada valor de leyenda se muestra como un porcentaje del conjunto.

Por ejemplo, si el valor de enero es 2,78 % cuando agredo una columna de leyenda que tiene valores A, B, C, el porcentaje se muestra como

A - 0,73 %

B- 1,71 %

C- 0,33 %, que es el porcentaje del total

pero quiero mostrarlo como

A- 26,4 %

B - 61,71 %

C- 11,89 %, que es el porcentaje del total por mes. cada elemento de leyenda debe sumar a 100%

¿Hay alguna manera de hacer esto en un gráfico de líneas?

saludos

6 REPLIES 6
Highlighted
Super User IV
Super User IV

@Samrawit21, intenta como

divide([measure], allexcept(Table, Table[month], Table[category]))

Oe

divide([measure], allexcept(Table, Table[category]))

Consulte también https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

https://youtu.be/6jTildcV2ho



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Hola @Samrawit21,

Por favor, comparta algunos datos ficticios con la estructura de la tabla sin procesar, entonces podemos hacer fórmula de codificación de prueba en él.

Cómo obtener respuestas a su pregunta rápidamente

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted

@v-shex-msft

I am using a line chart to display the distinct count of customers with multiple legend values. I want to show the count of customers as a percentage of the total per month.
Now each legend value is displayed as a percentage of the whole.
For example, if January had a percentage of value 2.78% when I added a legend column that has A, B, C values, the percentage is displayed as
A - 0.73%
B- 1.71%
C- 0.33%, which is the percentage of the total, but I want to show it like
A- 26.4%
B - 61.71%
C- 11.89%, which is the percentage of the total per month. each legend item must add to 100%
Is there a way to do this on a line chart?

 

 I also want to add another line chart, which sums up legend values A and B.

Is this possible to do?

Below is my sample data.

Regards,

 

 

LeyendaClientesYearMonth
A1212144201904
C8585899201904
C5858989201904
A9898877201905
A8989988201905
C8989999201905
A9999921201904
A2121212201903
B2121212201904
B1414121201904
B2221111201903
C4414141201903
C2121212201903
C7111212201902
C7777721201904
C8232323201904
C3333212201902
B2121233201905
B1241414201905
A1241414201902
A1212121201902
B4444455201904
C2121255201902
B4747777201903
Highlighted

Hola @Samrawit21,

Por favor, compruebe la siguiente fórmula de medida si funciona de su lado:

Measure =
DIVIDE (
    CALCULATE (
        COUNTA ( 'Table'[customers] ),
        ALLSELECTED ( 'Table' ),
        VALUES ( 'Table'[YearMonth] ),
        VALUES ( 'Table'[Legend] )
    ),
    CALCULATE ( COUNTA ( 'Table'[customers] ), ALLSELECTED ( 'Table' ) )
)

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted

@v-shex-msft 

Thank you for your reply!

 

 I also want to add another line chart, which sums up legend values A and B.

Is this possible to do?

 

 

Highlighted

Hola @Samrawit21,

Actualmente, no puede usar el campo de leyenda y varios campos de valor al mismo tiempo. Tal vez pueda intentar utilizar R visual para trazar manualmente el gráfico.

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors