cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Cómo encontrar el costo mínimo en una tabla por estado, mercado y longitud en Power BI

Tengo una tabla que contiene varios valores para Estado, Mercado, Longitud y Costo. Necesito calcular una nueva medida que muestre el costo mínimo disponible por estado/mercado/longitud. Intenté usar Min con FILTER, pero los resultados son incorrectos.

Dax:

MIN_COST=
var current_row_mkt = TABLE1[MARKET]
var current_row_state = TABLE1[STATE]
var current_row_lth = TABLE1[LONGITUD]
devolución
CALCULAR(
MIN(TABLE1[COSTO]),
FILTRO(
ALL(TABLE1),
TABLE1[STATE_cd] = current_row_state),
FILTRO(
ALL(TABLE1),
TABLA1[MERCADO]=current_row_mkt),
FILTRO(
ALL(TABLE1),
TABLA1[LONGITUD]=current_row_lth)
)

Tabla 1:

EstadoMercadoProveedorLongitudCosto
ALBhCOMPANY_A10002500
ALBhCOMPANY_B10002250
ALBhCOMPANY_C10002150
ALBhCOMPANY_D10002000
ALBhCOMPANY_E10002200
ALMoCOMPANY_A10001000
ALMoCOMPANY_B10001100
ALMoCOMPANY_C10001400
ALMoCOMPANY_D10001300
PeroBnCOMPANY_A1000200
PeroBnCOMPANY_B1000300
PeroBnCOMPANY_C1000400
PeroBnCOMPANY_D1000500
ALBhCOMPANY_A100003000
ALBhCOMPANY_B100003100
ALBhCOMPANY_C100003200
PeroBnCOMPANY_A500700
PeroBnCOMPANY_B500600
PeroBnCOMPANY_C500800
PeroBnCOMPANY_D500900

Resultados esperados:

EstadoMercadoProveedorLongitudCostoMIN_COST
ALBhCOMPANY_A100025002000
ALBhCOMPANY_B100022502000
ALBhCOMPANY_C100021502000
ALBhCOMPANY_D100020002000
ALBhCOMPANY_E100022002000
ALMoCOMPANY_A100010001000
ALMoCOMPANY_B100011001000
ALMoCOMPANY_C100014001000
ALMoCOMPANY_D100013001000
PeroBnCOMPANY_A1000200200
PeroBnCOMPANY_B1000300200
PeroBnCOMPANY_C1000400200
PeroBnCOMPANY_D1000500200
ALBhCOMPANY_A1000030003000
ALBhCOMPANY_B1000031003000
ALBhCOMPANY_C1000032003000
PeroBnCOMPANY_A500700600
PeroBnCOMPANY_B500600600
PeroBnCOMPANY_C500800600
PeroBnCOMPANY_D500900600
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Crea una nueva medida que sea algo así como:
Coste mínimo = CALCULATE(MIN('Table'[COST]), REMOVEFILTERS('Table'[VENDOR], 'Table'[COST]))
Capture.PNG

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Gracias es una gran solución.

Syndicate_Admin
Administrator
Administrator

Crea una nueva medida que sea algo así como:
Coste mínimo = CALCULATE(MIN('Table'[COST]), REMOVEFILTERS('Table'[VENDOR], 'Table'[COST]))
Capture.PNG

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

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

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.