Forum Discussion
Formula dax
- 2 years ago
Hi @tiagolangerdof,
You just made a Mix when you copy the measure
Change this with ==>
Min( 'Ordem de compra'[indice] ),
I made this hope that will help you.
MEASURE =
VAR ValidIndex =
SELECTEDVALUE ( Cust_Orders[Indice] )
VAR Salescumul =
CALCULATE (
SUM ( Cust_Orders[Qte] ),
Cust_Orders[Indice] <= ValidIndex,
ALL ( Cust_Orders ),
ALLEXCEPT ( Cust_Orders, Cust_Orders[Item] )
)
VAR ValuePreviousSalesCumul =
CALCULATE (
SUM ( Cust_Orders[Qte] ),
Cust_Orders[Indice] <= ValidIndex - 1,
ALL ( Cust_Orders ),
ALLEXCEPT ( Cust_Orders, Cust_Orders[Item] )
)
VAR Dernierindexcumulachat =
CALCULATE (
MIN ( Achats[Indice] ),
Salescumul <= Achats[CUmul],
REMOVEFILTERS ()
)
VAR Premierindexcumulachat =
CALCULATE (
MIN ( Achats[Indice] ),
ValuePreviousSalesCumul <= Achats[CUmul],
REMOVEFILTERS ()
)
VAR div =
CALCULATE (
MIN ( Achats[Indice] ),
ValuePreviousSalesCumul <= Achats[CUmul],
REMOVEFILTERS ()
)
VAR result =
CALCULATE (
CONCATENATEX (
FILTER (
Achats,
Achats[Indice] IN { Premierindexcumulachat, Dernierindexcumulachat }
),
Achats[PO],
", "
),
REMOVEFILTERS ()
)
RETURN
result
Cumul is a calculated clumn in the Table Achats (Purchase Orders)
Thank you very much!! I'm seeing a light!! But here the result was partial, see below: a question, why when I use a calculated column the result is different from a measure? Below, the first image is of the measure and the second is of the calculated column:This is a measure that didn't yield the correct calculation.This is a calculated column.