Forum Discussion
Jakob_BI
3 years agoHelper I
Last available date value vs current date value increase or decrease
Hi all, Step 1. I need help to calculate if there is an increase or decrease in value between the latest dates for a given batch on a specific product. Step 2. I need to count if there i...
Jakob_PBI
3 years agoFrequent Visitor
i added the power bi file here to show the desired result:
https://www.dropbox.com/s/55k7iv3sdx8wrcp/PBI%20problem%20file.pbix?dl=0
I still need help to calculate those 2 columns.
I can see there was 1 wrong data in the original datasample. Here is the updated sample (just 1 cell correction).
| batch | Product | value | purification date | Calculate: Increase or decrease between latest available date for batch | Calculate: 5 increases or decreases consecutive |
| A | A | 10 | 01-01-2023 | 0 | 0 |
| B | A | 11 | 13-01-2023 | 1 | 0 |
| C | A | 12 | 25-01-2023 | 1 | 0 |
| D | A | 13 | 01-02-2023 | 1 | 0 |
| E | A | 14 | 02-02-2023 | 1 | 0 |
| F | A | 15 | 05-02-2023 | 1 | 1 |
| A | B | 11 | 01-01-2023 | 0 | 0 |
| B | B | 10 | 13-01-2023 | -1 | 0 |
| C | B | 9 | 25-01-2023 | -1 | 0 |
| D | B | 12 | 01-02-2023 | 1 | 0 |
| E | B | 13 | 02-02-2023 | 1 | 0 |
| F | B | 12 | 05-02-2023 | -1 | 0 |