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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Ninex
New Member

Calcular Mediana de lineas por TKT

Hola a todos,

En una tabla de Ventas con la siguiente estructura

 

Nro TKT.  Id Articulo Cantidad      Precio    Importe TKT

1                   A001         2             $ 10.00.      $ 35.00

1                   A002         1             $ 15.00.      $ 35.00

2                   A001         1             $ 10.00.      $ 10.00

3                   B005         1             $   8.50.      $ 33.50

3                   A004         2             $  10.00      $ 33.50

3                   B002         1             $    5.00      $ 33.50

 

Quisiera saber como hacer para hacer una medida que calcule la mediana de cantidad de lineas (filas) x TKT.

Tambien me gustaria saber como hacer el SUM de Importe x TKT.

Desde ya muchas gracias y saludos a todos.

 

Daniel

 

 

 

 

 

 
 

 

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Ninex ,

 

Please show us the result you want. This will help us understand your requirements better.

 

 

Best Regards,

Icey

AllisonKennedy
Super User
Super User

I don't know if I understand all of your question, but for the average or mediana you could try:

Mediana = AVERAGEX(Tabla, Tabla[Cantidad]*Tabla[TKT])

You can do the same for SUM, just not sure what you need to multiply as your sample table looks like Importe and TKT are the same column?

SUMX(Tabla, Tabla[Cantidad]*Tabla[TKT])

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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