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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

7 REPLIES 7
v-shex-msft
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.
Anonymous
Not applicable

@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

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.

Hola

Estoy tring para crear un gráfico de líneas con los siguientes datos. Necesito la salida del gráfico de líneas para mirar según tabel 2. pero no toma % de COlumns - Considera % del total general.

Los campos son - nombre del producto - en col / Axis. Mes en fila/ leyenda. Se utiliza COunt de id de cliente.

Agradezca su ayuda.

Reshma_Doshi_0-1628567382387.png

Anonymous
Not applicable

@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?

 

 

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.
amitchandak
Super User
Super User

@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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors