Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good Morning,
sorry for my english.
How calculate increase / Decrease item and % increse in this table?
Thank you
Solved! Go to Solution.
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] ) - b
Measure2 =
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
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
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
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] ) - b
Measure2 =
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
Hello there @andreaturri27 ! You can try the following for the variation:
Variation =
VAR _current =
SUM ( Table[Prezzo acquisto] )
VAR _previous =
CALCULATE (
_current,
FILTER (
ALL ( Table[Numero Ordine] ),
Table[Numero Ordine]
= ( SELECTEDVALUE ( Table[Numero Ordine] ) - 1 )
)
)
RETURN
_current - _previous
And for the percentage change:
% Variation =
VAR _current =
SUM ( Table[Prezzo acquisto] )
VAR _previous =
CALCULATE (
_current,
FILTER (
ALL ( Table[Numero Ordine] ),
Table[Numero Ordine]
= ( SELECTEDVALUE ( Table[Numero Ordine] ) - 1 )
)
)
RETURN
DIVIDE ( _current - _previous, _previous, 0 )
And format it as a % field.
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |