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)
- tiagolangendorf2 years agoRegular Visitor
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.
- tiagolangendorf2 years agoRegular Visitor
Hello I couldn't do it as you did, is there any other formula that you didn't show?
- tiagolangendorf2 years agoRegular Visitor
My result was not the same, can anyone help me? in our friend JamesFR06's formula it seems that the accumulated works in my formula it doesn't. Here is a link to my archive
- JamesFR062 years ago
Resolver IV
Hi @tiagolangerdof,
You just made a Mix when you copy the measure
Change this with ==>
Min( 'Ordem de compra'[indice] ),