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
danie_figueroa
Frequent Visitor

Como calcular el total vendido cuando los valores de los productos son distintos

Hola a todos, 

Tengo la siguiente situacion, estoy trabajando en un power bi para mostrar los totales de las "Nota_pedido" que tengo en un excel que funcionara como origen de los datos, el excel tiene el siguiente formato, el cual no me permite calcular de manera correcta el total real del monto neto facturado en dolar:

Nota_PedidoMonto_Neto_Facturado_Dolar
3785574644,45
378557387,04
3785181620,81
378518405,2
3784983800,67
378498422,3
378440844,59
378433382,08
378394404,2
378366422,08
378357413,82
3783342744,39
3782596444,91
378257400,41
378199412,37
378158422,43
3781211540,23
3781131084,78
378040420
3780392843,19
3779841996,41
377942814
3779421221
377922422,43
3779043379,64
377856422,57
377833395,18
377833790,36
377825462,49
377708386,91
3777021203,47
377654409,2
377637417,4
377602405,73
377570383,22
377560397,91
377560-397,91
3775253305,79
377510402,16
377481397,95
377449412,5
377448397,95
377363400,41
377361400,41
377322844,54
3772862407,85
377243423,97
377219428,91

 

Como se puede apreciar, en la primera columna,hay  Nota_pedido" que se duplican, la idea es lograr sumar los valores de cada "nota_pedido" y que se muestre el valor total correspondiente a la "nota_pedido", por ejemplo tenemos el primer valor: 

378557 =($4644,45 +$387,04) ==> 378557 = $5031,49

 

A su vez la formular o solución debe considerar las situaciones de valores negativos, es decir en caso de que la "nota_pedido" este duplicada pero muestra un valor positivo y otro negativo, se debe descontar y quedar en 0, por ejemplo tenemos la "nota_pedido" 377560, la cual aparece con los valores ($397,91) y ($-397,91) por lo que al sumar todo, esa "nota_pedido" debe quedar en 0

 

Espero que se haya comprendido la situacion y de antemano agradezco mucho toda la ayuda posible.

Saludos!!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @danie_figueroa 

 

You can try the following two methods.

Column:

Column =
CALCULATE (
    SUM ( 'Table'[Monto_Neto_Facturado_Dolar] ),
    FILTER ( 'Table', [Nota_Pedido] = EARLIER ( 'Table'[Nota_Pedido] ) )
)

vzhangti_0-1657528660891.png

Measure:

Measure =
CALCULATE (
    SUM ( 'Table'[Monto_Neto_Facturado_Dolar] ),
    FILTER (
        ALL ( 'Table' ),
        [Nota_Pedido] = SELECTEDVALUE ( 'Table'[Nota_Pedido] )
    )
)

vzhangti_1-1657528733983.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @danie_figueroa 

 

You can try the following two methods.

Column:

Column =
CALCULATE (
    SUM ( 'Table'[Monto_Neto_Facturado_Dolar] ),
    FILTER ( 'Table', [Nota_Pedido] = EARLIER ( 'Table'[Nota_Pedido] ) )
)

vzhangti_0-1657528660891.png

Measure:

Measure =
CALCULATE (
    SUM ( 'Table'[Monto_Neto_Facturado_Dolar] ),
    FILTER (
        ALL ( 'Table' ),
        [Nota_Pedido] = SELECTEDVALUE ( 'Table'[Nota_Pedido] )
    )
)

vzhangti_1-1657528733983.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.