Forum Discussion
Increase Order and Price
- 4 years ago
Hi, andreaturri27
According to your description, you can create two measures.
Like this:
Measure1 = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] < SELECTEDVALUE ( 'Table'[ExpectedDeliveryDate] ) ), [ExpectedDeliveryDate] ) VAR b = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] = a ), [Prezzo acquisto] ) RETURN MAX( 'Table'[Prezzo acquisto] ) - bMeasure2 = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] < SELECTEDVALUE ( 'Table'[ExpectedDeliveryDate] ) ), [ExpectedDeliveryDate] ) VAR b = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] = a ), [Prezzo acquisto] ) RETURN DIVIDE ( MAX ( 'Table'[Prezzo acquisto] ) - b, MAX ( 'Table'[Prezzo acquisto] ) )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,Community Support Team _ Janey
- 4 years ago
Hi, andreaturri27
You need to modify the code according to your needs.
Like :
Measure1 = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] < SELECTEDVALUE ( 'Table'[ExpectedDeliveryDate] )&& [item] < SELECTEDVALUE ( 'Table'[item] ) ), [ExpectedDeliveryDate] ) VAR b = MAXX ( FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] = a && [item] < SELECTEDVALUE ( 'Table'[item] )), [Prezzo acquisto] ) RETURN MAX( 'Table'[Prezzo acquisto] ) - bDid I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,Community Support Team _ Janey
Thaks for reply v-janeyg-msft but in my table have a lot value in this table.
i must verify item and ExpectedDeliveryDate...
how do to solve?
Thank you
Andrea
Hi, andreaturri27
You need to modify the code according to your needs.
Like :
Measure1 =
VAR a =
MAXX (
FILTER (
ALL ( 'Table' ),
[ExpectedDeliveryDate] < SELECTEDVALUE ( 'Table'[ExpectedDeliveryDate] )&&
[item] < SELECTEDVALUE ( 'Table'[item] )
),
[ExpectedDeliveryDate]
)
VAR b =
MAXX (
FILTER ( ALL ( 'Table' ), [ExpectedDeliveryDate] = a &&
[item] < SELECTEDVALUE ( 'Table'[item] )),
[Prezzo acquisto]
)
RETURN
MAX( 'Table'[Prezzo acquisto] ) - b
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Community Support Team _ Janey