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])
)
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])
)
- Shawry2 years ago
Helper I
Thanks for responding. I've tried both code blocks but both don't appear to be working. I've updated the table references accordingly to be:
Calls Past 6 Weeks = CALCULATE( SUM('General Enquiries - Daily'[Calls Answered]), 'Date'[Past 6 weeks or Prior Period] = "Past 6 weeks" )However, not returning any results in either column.
I also tried using a Measure how getting the same results and no values are being returned. Measure is entirely blank.
You can also see below that my 'Past 6 Weeks or Prior Period' column is returning results within my Date table.
Any further ideas as to why this isn't working? Thanks
- Anonymous2 years agoNot applicable
Hi,
Thanks for the solution sroy_16 probvided, and i want to offer some more infotmation for user to refer to.
hello Shawry , based on your description, you can try the following measures
Calls Past 6 Weeks = CALCULATE( SUM('General Enquiries - Daily'[Calls Answered]), 'Date'[Past 6 weeks or Prior Period] = "Last 6 weeks" )Calls Past 6 Weeks_preperiopd = VAR _filter = FILTER ( ALLSELECTED ( 'Date' ), [Past 6 weeks or Prior Period] = "Last 6 weeks" ) VAR preyear_mindate = EDATE ( MINX ( _filter, [Date] ), -12 ) VAR preyear_maxdate = EDATE ( MAXX ( _filter, [Date] ), -12 ) RETURN CALCULATE ( SUM ( 'General Enquiries - Daily'[Calls Answered] ), DATESBETWEEN ( 'Date'[Date], preyear_mindate, preyear_maxdate ) )Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.