Forum Discussion
Eureka
Advocate I
4 years agoComparison vs last year on same perimeter
Hello, I want to create a metric to compare Sales Qty with last year but I want to remove the customers for which I have data for last year and not for this year. here is my table: Custo...
- 4 years ago
Eureka , Try a measure like
Diff =
Var _ytd = [ytd]
car _lytd = [LYTD]
return
sumX(Values(Table[Customer]), if(not(isblank(_ytd) ) && not(isblank(_lytd) ) , _ytd-_lyd, blank()) )
Eureka
Advocate I
4 years agoThank you amitchandak
I am using the sumx you propose and it's working fine for one month but it doen't solve my problem:
If I have several month in my table:
| Customer Id | Date | Qty |
| A | 1/01/22 | 10 |
| A | 1/01/21 | 50 |
| A | 1/02/21 | 25 |
| B | 1/01/21 | 20 |
| B | 1/02/21 | 15 |
| B | 1/02/22 | 30 |
If in my report I select the months january 22 and february 22, the formula will include A and B . I have 40 vs 110 instead of 40 vs 75.
In this case I want to remove B for january and remove A for february .
Do you have an idea how I can do it ?