Forum Discussion
Measure total of difference
- 5 years ago
AVIE , Try diff like
Diff = SUMX(VALUES('Date'[Period]),if(not(ISBLANK([Prior Value])) && not(ISBLANK([Total value])),[Total value] -[Prior Value],BLANK()))
Thanks, amitchandak ! This works! I just have one question for my understanding - why do these formulas work when entering them in the dates table, and not when you enter them in the other table with all data?
Dear amitchandak ,
Can you please reply to my last question above:
"I just have one question for my understanding - why do these formulas work when entering them in the dates table, and not when you enter them in the other table with all data?"
Also, is it possible to add a second measure that only takes account the "diff" of the first 2 months after the month in the delivery period. Example:
| Delivery period | Economical period | Difference2 |
| January 2020 | January 2020 | 0 |
| January 2020 | February 2020 | -20 |
| January 2020 | March 2020 | 0 |
| January 2020 | April 2020 | 0 |
| Total | -20 |
So for delivery period January 2020, only the differences for February and March should show up for this measure, meaning the difference confirmed in April as in one of the posts above should be left out.
Thank you!