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
Anonymous
Not applicable

cómo obtener la suma de valores distintos usando dax

Hola Equipo,

Mis datos tienen SKUs y sus cantidades. Por ejemplo:

RegiónSkuQty
R1SKU1300
R2SKU1300
R3SKU1300
R1SKU2500
R2SKU2500
R3SKU2500
R4SKU2500
R5SKU2500

Digamos que estoy mostrando estos datos en un gráfico de líneas y no teniendo en cuenta las regiones que tengo.

Quiero mostrar la suma de la venta de cantidades distintas de SKU y no sumar todas estas. Por ejemplo: Me gustaría mostrar el uso total de SKUs es (300+500 a 800).

Pero ahora mismo si estoy resumiendo la columna, estoy obteniendo suma completa como 500 * 5 + 300 * 3 (que es obvio).

¿Hay alguna manera a través de la cual puedo lograr las cantidades totales para ser 800 aparte del otro número.

Además, hacer un promedio no funcionará ya que las SKUs no se repiten igual número de veces. Podría haber 2 o más SKUs con la misma cantidad, así que desea asegurarse de que ambas cantidades se agregan

Gracias de antemano

@Greg_Deckler @amitchandak @ImkeF

6 REPLIES 6
Anonymous
Not applicable

Muchas gracias a todos por ayudar.

Sin embargo, probé el método compartido por @amitchandak y funcionó para mí

Una vez más, gracias por proporcionar sus soluciones.

Saludos

Rohan

v-yiruan-msft
Community Support
Community Support

Hola @RohanChhabra ,

Puede crear una medida como se muestra a continuación:

Sum of distinct values = SUMX(SUMMARIZE(DISTINCT('table'[SKU]),'table'[SKU],"Quantity",DISTINCT('table'[Qty])),[Quantity])

sum of distinct values.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hola

Escribir estas medidas

Cantidad: MIN('Tabla'[Cantidad])

Medida ?SUMX(VALUES('Table'[SKU]),[Cantidad])

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@RohanChhabra ,

Por favor, intente como

sumx(summarize(table,table[SKU],"_max",max(table[QTY])),[_max])

Muchas gracias

Tahreem24
Super User
Super User

Try below Dax measure:
Measure = Calculate(sum(Table[Qty]), AllExcept(Table, Table[SKU]))

Don't forget to give Thumbs up and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.