Hi Guys,
Could you help?
I'm trying to create a sales report which summarises the sales by Week, Period to date & YTD. I've managed to calculate the YTD it's the Period to date I'm having the issues with.
In the calendar table above, I've selected Week 6 (Let's say we have sold 10 units every week to make it easier to understand) So week 6 would 10 units. Period to date would be 20 Units & YTD would be 60 Units.
Below is my measure I used to calculate the YTD units, which works.
For this, I created a couple of other measures, the first measure [WeekMin] takes the minimum week number, the second measure [SelectedWeek] does what it says, uses the selected week from the slicer. The sums all the weeks from week 1 to the week selected:
Sales YTD =
CALCULATE (
[Weekly Sales],
FILTER (
'Sales Table',
'Sales Table'[Time.Week of Year] >= [WeekMin]
&& 'Sales Table'[Time.Week of Year] <= [WeekSelected]
)
)
So basically I would like to calculate the Period to date based on the currently selected week. A few examples:
If I selected week 4 the Period to date units would be 40.
If I selected week 7 the Period to date units would be 30.
Just to note not all periods are 4 weeks, some are 5 weeks.
Many thanks for you help!
L
Could you help?
I'm trying to create a sales report which summarises the sales by Week, Period to date & YTD. I've managed to calculate the YTD it's the Period to date I'm having the issues with.
In the calendar table above, I've selected Week 6 (Let's say we have sold 10 units every week to make it easier to understand) So week 6 would 10 units. Period to date would be 20 Units & YTD would be 60 Units.
Below is my measure I used to calculate the YTD units, which works.
For this, I created a couple of other measures, the first measure [WeekMin] takes the minimum week number, the second measure [SelectedWeek] does what it says, uses the selected week from the slicer. The sums all the weeks from week 1 to the week selected:
Sales YTD =
CALCULATE (
[Weekly Sales],
FILTER (
'Sales Table',
'Sales Table'[Time.Week of Year] >= [WeekMin]
&& 'Sales Table'[Time.Week of Year] <= [WeekSelected]
)
)
So basically I would like to calculate the Period to date based on the currently selected week. A few examples:
If I selected week 4 the Period to date units would be 40.
If I selected week 7 the Period to date units would be 30.
Just to note not all periods are 4 weeks, some are 5 weeks.
Many thanks for you help!
L