cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

por ciento del total

Hola, ¿puedes ayudarme?
Me gustaría calcular el porcentaje acumulado de ventas de mis vendedores.
El resultado esperado sería la columna amarilla.
Si tuviera una fecha sería más fácil, pero mi tabla es sólo esa información, nombre del vendedor y ventas.

Enlace sobresalir con fórmula y datos.

https://we.tl/t-jfLwoutYi5

Souza_0-1594049756102.png

3 REPLIES 3
edhans
Super User
Super User

Vas a necesitar alguna forma de saber cómo acumular. Agregué una columna de índice en Power Query (menú Agregar columna, índice.)

edhans_0-1594050866436.png

Cumulative Percent = 
 VAR varCurrentIndex =
    MAX( 'Table'[Index] )
VAR varGrandTotal =
    SUMX(
        ALL( 'Table' ),
        'Table'[sales]
    )
VAR varCumulativeTotal =
    SUMX(
        FILTER(
            ALL( 'Table' ),
            'Table'[Index] <= varCurrentIndex
        ),
        'Table'[sales]
    )
VAR Result =
    DIVIDE(varCumulativeTotal,varGrandTotal,0)
RETURN
    Result



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

@edhans

Ouw, Perfecto. Así que funcionó perfectamente, muchas gracias. ¿Sería que en lugar de usar el índice, usar rank en dax funcionaría?

Tal vez, pero tendría que lidiar con los problemas de un empate, que podría ser manejado con el indicador DENSE vs SKIP en RANKX. Pero seguramente hará que el DAX sea más complejo y posiblemente ralentizará el modelo dependiendo de cuántos esté haciendo. 4-5, o 400-500 no importará. Si 40 personas se encuentran en miles o decenas de miles, verá que el uso de RANKX comienza a ralentizar las cosas para sus objetos visuales si se usa de esta manera.

Y supongo que sabe que siempre haría totales acumulativos de mayor a menor (o invertido) en comparación con la forma en que los datos entran.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors