Forum Discussion
Anonymous
6 years agoNot applicable
SQL to DAX Convert
Hola Soy nuevo en DAX, por favor ayuda a convertir el siguiente código T-SQL a su equivalnet DAX. Estoy generando total de ejecución (cummulative) usando TSQL el mismo que necesito en DAX, po...
Anonymous
6 years agoNot applicable
Gracias por su respuesta! . Estoy teniendo problemas en este paso:
EVALUATE
SUMMARIZE (
FILTER ( Inv_Fact_Inventory,
Inv_Fact_Inventory[Dashboard]="Current Inventory" && Inv_Fact_Inventory[Inventory Status]="ASSIGNED" && Inv_Fact_Inventory[Inventory Order Type]="TENDERED NOT SHIPPED" ),
,
"Final_date", Inv_Fact_Inventory[Received Date],
"Units Assigned", DISTINCTCOUNT(Inv_Fact_Inventory[CURINV_CARGO_ID])
)
En Final_Date, a continuación se muestra el error
Siguiente cuando intento ejecutar toda la expresión im obteniendo el mismo valor para todos los registros. Me estoy perdiendo algo aquí..
Aquí está el código actualizado im usando ahora:
EVALUATE
VAR tab =
SUMMARIZE (
FILTER (
Inv_Fact_Inventory,
Inv_Fact_Inventory[Dashboard]="Current Inventory" && Inv_Fact_Inventory[Inventory Status]="ASSIGNED" && Inv_Fact_Inventory[Inventory Order Type]="TENDERED NOT SHIPPED"
),
Inv_Fact_Inventory[Received Date],
"Units Assigned", DISTINCTCOUNT( Inv_Fact_Inventory[CURINV_CARGO_ID] )
)
RETURN
SELECTCOLUMNS (
tab,
"Final_cut", SUMX ( FILTER ( tab, Inv_Fact_Inventory[Received Date] <= MAX ( Inv_Fact_Inventory[Received Date] ) ), [Units Assigned] )
)
Salida:
Por favor, aconseje
v-yingjl
Community Support
6 years agoHola @sarthaks ,
Modifique la fórmula de esta manera:
EVALUATE
VAR tab =
SUMMARIZE(
FILTER(
'Inv_Fact_Inventory',
'Inv_Fact_Inventory'[Dashboard] = "Current Inventory" &&
'Inv_Fact_Inventory'[Inventory Order Type] = "TENDERED" &&
'Inv_Fact_Inventory'[Inventory Status] = "ASSIGNED"
),
'Inv_Fact_Inventory'[Received Date],
"Units Assigned",
CALCULATE(COUNT(Inv_Fact_Inventory[CURINV_CARGO_ID]))
)
RETURN
SELECTCOLUMNS(
tab,
"Final_Cut",
var d = 'Inv_Fact_Inventory'[Received Date]
return
SUMX(
FILTER(
tab,
[Received Date] <= d
),
[Units Assigned]
)
)
order by [Final_Cut] descUsted puede obtener su resultado esperado, a continuación está mi muestra y resultado:
Best Looks,
Yingjie Li
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
- Anonymous6 years agoNot applicable
Tu solución funcionó. Gracias por ayudar..