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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ralmarRojas
Regular Visitor

calcular total de un calculo de cantidad por precio

mi consulta es como hacer si estoy sacando un calculo de cantidad por precio de cada articulo, renglon por renglon pero de dos tamblas distintas, no puedo usar sumx. este proceso lo hace bien, pero cuando tengo todos los valores articulo por articulo, cuando totaliza, en lugar de sumar los resultados, hace la misma operacion para el total, cantidades totales por precio promedio de todos los articulos, y el valor no es igual a la suma de cada renglon. como soluciono esto.

 

ralmarRojas_0-1672755628761.png

 

2 REPLIES 2
ralmarRojas
Regular Visitor

Hola, no logro encontrar la solucion a mi problema con estas ayudas. logre poner el subtotal en cero, pero no encuentro la formula para que sume la formula anterior.

en una tabla llamada ctacte-d tengo las cantidades vendidas y en otra tabla tengo costoart el costo unitario, se relacionan por la tabla nombre_producto y Calendario.

yo quiero saber el costo de mercaderia vendida CMV multiplicando ctacta-d.cantindad * costoart.precio unitario y a cada resultado por producto sumarlo. Esto no logro hacerlo.

 

Anonymous
Not applicable

Hi @ralmarRojas ,

 

You can correctly calculate the totals by using HASONEVALUE or SUMMARIZE. Please kindly refer to

Learn How to Fix Totals and Subtotals in DAX (theexcelclub.com)

Solved: Re: Sum of values in a measure with divide measure - Microsoft Power BI Community

You can create a measure modeled on the following

SUMX(SUMMARIZE(product_sales,Products[Product],’date'[Year]),[hasonevalue]), [hasonevalue])

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.