Forum Discussion
Petur-Ruhl
4 years agoFrequent Visitor
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:
| Date | Sales | Sales L1LY |
| 18.5.2021 | 100 | |
| .... | ... | ... |
| 16.5.2022 | 200 | |
| 17.5.2022 | 150 | 100 |
| 18.5.2022 | 300 |
All help is highly appreciated.
maybe try this
if(max(date)=today()-1,CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY)) )
1 Reply
- ryan_mayu
Super User
maybe try this
if(max(date)=today()-1,CALCULATE('Sales Transactions'[Sales],DATEADD('Date'[Date],-364,DAY)) )