Forum Discussion
How to display different time periods on the same chart?
- 2 years ago
Alternatively you can try this as well.
You can also use these two measure and in the visual add both the measures to achieve this.
Calls Past 6 Weeks =
CALCULATE(
SUM('Calls'[Volume]),
'Date'[Past 6 weeks or Prior Period] = "Past 6 weeks"
)
Calls Same Period Last Year =
CALCULATE(
SUM('Calls'[Volume]),
'Date'[Past 6 weeks or Prior Period] = "Past 6 weeks",
SAMEPERIODLASTYEAR('Date'[Date])
)
Hi Shwary,
Try using this code which would act as a dynamic measure and change the value dynamically.
Calls Comparison =
VAR CurrentDate = MAX('Date'[Date])
VAR IsPast6Weeks =
CALCULATE(
SUM('Calls'[Volume]),
'Date'[Past 6 weeks or Prior Period] = "Past 6 weeks"
)
VAR IsSamePeriodLastYear =
CALCULATE(
SUM('Calls'[Volume]),
'Date'[Past 6 weeks or Prior Period] = "Past 6 weeks",
SAMEPERIODLASTYEAR('Date'[Date])
)
RETURN
IF(
YEAR(CurrentDate) = YEAR(TODAY()),
IsPast6Weeks,
IsSamePeriodLastYear
)
Let me know if the solution works.