Forum Discussion
ategally
8 years agoFrequent Visitor
This Week and Last Week
I need to create a base derivative for This Week and Last Week so I can add this to any base measure to give for example Sales for This Week or Sales for Last Week. Please help.
Anonymous
8 years agoNot applicable
HI ategally,
Maybe you can take a look at below formula:
This Week Sales =
CALCULATE (
SUM ( table[Sales] ),
FILTER (
ALL ( Date ),
YEAR ( Date[Date] ) = YEAR ( TODAY () )
&& WEEKNUM ( Date[Date], 1 ) = WEEKNUM ( TODAY (), 1 )
)
)
Last Week Sales =
CALCULATE (
SUM ( table[Sales] ),
FILTER (
ALL ( Date ),
YEAR ( Date[Date] ) = YEAR ( TODAY () )
&& WEEKNUM ( Date[Date], 1 ) = WEEKNUM ( TODAY (), 1 )-1
)
)
Regards,
Xiaoxin Sheng
ategally
8 years agoFrequent Visitor
Thank you Anonymous
I have implemented this and all I get is the same data for each day:
| 02/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 13/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 15/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 10/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 12/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 14/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 09/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 11/10/2017 00:00:00 | 8421206.688 | 22962675.768 |
| 01/01/2017 00:00:00 | 8421206.688 | 22962675.768 |
- Anonymous8 years agoNot applicable
Hi ategally,
My formulas are measure, I think you use them as the calcualte column,right?
In addition, if you share some sample data, it will be help for analysis.
Regards,
Xiaoxin Sheng