0
votes

I have a table with the sales from last 2 years, and I want to compare the sales from this year with the same natural day last year. For example, Sunday 1st of April 2018 will be compared with Sunday 2nd April 2017.

In order to do that I have created the measure

sales_last_year = CALCULATE(Sales[Revenue]); SAMEPERIODLASTYEAR(DATEADD('Calendar'[Date];+1;DAY)))

And I have created another measure where I have the value from the same day last year:

Prueba_sales_last_year = CALCULATE(Sales[Revenue]); SAMEPERIODLASTYEAR('Calendar'[Date]))

The result is the following:

Sales last year

As you can see the sales per day shows 5.316€ and 3.546€, which is correct, but the total is 111.796 €, which is not correct. However, the measure with the formula without the natural day the sum of the two rows is correct. How could I solve this?

Thank you very much in advance

1
Why is 8.855 correct and not 5.316 + 3.546 = 8.862?Alexis Olson
The sum value should be 8.862 instead of 111.796. The sum of the other measure is different because has different values, takes into account the same day last year instead of the natural dayInigoLana

1 Answers

0
votes

I just changed the order to calculate the date and it was solved.

sales_last_year = CALCULATE(Sales[Revenue]);DATEADD( SAMEPERIODLASTYEAR('Calendar'[Date]);+1;DAY))