Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello everyone,
i have a slicer that seelcts week number
i have a line chart , x-axis is date and y-axis is total sales
i created a measure to calculate last week sales called Previous week sales
today is Friday 28 april 2023 which is week 18
week 18 starts from monday 24 2023 and ends sunday 30 2023
week 17 starts monday 17 2023 and ends sunday 23 2023
if i selected week 18 on my slicer
i want the line chart to return dates from monday 17 to max date which is sunday 23
how can i achieve this?
@tamerj1 @johnt75 @FreemanZ @amitchandak
Solved! Go to Solution.
i found a slution , create a new calander table completely separt no relationships
create a measure
Filtering =
VAR selectedweek = MAX(Calander[Week ID])
VAR lastweek = selectedweek - 1
VAR weekstart = CALCULATE(MIN(Calander[Date]),REMOVEFILTERS(Calander[Date]),Calander[Week ID] = lastweek)
VAR weekend = MAX(Calander[Date])
VAR result = IF(AND(MIN('Calander Inactive'[Date]) >= weekstart, MAX('Calander Inactive'[Date]) <= weekend), 1, 0)
RETURN
result
add the date from seperate calendar table to line chart on x-axis
create a new measure
Line Chart Sales = CALCULATE([Sales],REMOVEFILTERS(Calander[Date]),Calander[Date] = MAX('Calander Inactive'[Date]))
i found a slution , create a new calander table completely separt no relationships
create a measure
Filtering =
VAR selectedweek = MAX(Calander[Week ID])
VAR lastweek = selectedweek - 1
VAR weekstart = CALCULATE(MIN(Calander[Date]),REMOVEFILTERS(Calander[Date]),Calander[Week ID] = lastweek)
VAR weekend = MAX(Calander[Date])
VAR result = IF(AND(MIN('Calander Inactive'[Date]) >= weekstart, MAX('Calander Inactive'[Date]) <= weekend), 1, 0)
RETURN
result
add the date from seperate calendar table to line chart on x-axis
create a new measure
Line Chart Sales = CALCULATE([Sales],REMOVEFILTERS(Calander[Date]),Calander[Date] = MAX('Calander Inactive'[Date]))
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |