Forum Discussion

Petur-Ruhl's avatar
Petur-Ruhl
Frequent Visitor
4 years ago
Solved

Sales L1LY

Hello everyone,

 

I am trying to create a measurement that takes in the sales for the same day last year - 1 day (so Dateadd would be -364), but only narrow it down to Today - 1 in a measurement. 

I have a Date table and I get it to work but when I try to narrow it only for that one day my values disapears but the Total still hangs in there.


So my current formula works like:

 

Sales L1LY =  CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY)) 
Which gives me all the dates, which is great. but now I would only like see the value for Today -1
 
When i try something like 
CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY), filter(Date,[Date]=Today()-1)) the value dissapears but the total changes to a random value.
 My Ideas solution would be like:
DateSalesSales L1LY 
18.5.2021100 
..........
16.5.2022200 
17.5.2022150100
18.5.2022300 

 

All help is highly appreciated.

 

  • Petur-Ruhl 

    maybe try this

    if(max(date)=today()-1,CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY)) )

1 Reply

  • Petur-Ruhl 

    maybe try this

    if(max(date)=today()-1,CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY)) )