Forum Discussion
MichaelG_NAC
3 years agoFrequent Visitor
Comparing value between years based on another column
Hello
I am looking to compare Values between diffrent years
| Year | Unique | Value |
1 | A | 5 |
| 1 | B | 10 |
| 2 | A | 15 |
| 3 | C | 16 |
| 2 | B | 20 |
so at the end im looking to have a subtraction from the highest year - the lowest year based on the Unique
| Unique | Value |
| A | 10 (15-5) |
| B | 10 (20-10) |
| C | 16 |
Would this be possible or would another method be needed
Hi,
try this:
Measure 4 = var _max = CALCULATE(max('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))var _min = CALCULATE(min('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))returnif(COUNT('Table (3)'[Unique])=1,_max,_max - _min)If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
1 Reply
- DOLEARY85Resident Rockstar
Hi,
try this:
Measure 4 = var _max = CALCULATE(max('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))var _min = CALCULATE(min('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))returnif(COUNT('Table (3)'[Unique])=1,_max,_max - _min)If I answered your question, please mark my post as solution, Appreciate your Kudos 👍