Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Shawry
Helper I
Helper I

How to display different time periods on the same chart?

Hi, 

 

I have a Date table, which includes a column called 'Past 6 weeks or Prior Period', which essentially says 'Past 6 weeks', 'Prior Period' or 'False'. 

 

I'm wanting to display the volume of calls in a single chart so that you can compare the last 6 weeks call volume, against the same period last year. I'm struggling to understand how to model this and graph the different dimensions. 

 

I've managed to display the two separately on invidivual charts (as below) using filtering, but would ideally like to combine these into a single chart. 

 

Shawry_1-1717644757932.png

 

Does anyone know how to tackle this issue or model this to display accordingly? 

 

Thanks

 

1 ACCEPTED SOLUTION
sroy_16
Resolver II
Resolver II

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])
)

View solution in original post

4 REPLIES 4
sroy_16
Resolver II
Resolver II

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])
)

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. 

 

Shawry_0-1717716121506.png

 

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. 

 

Shawry_1-1717716966422.png

 

Any further ideas as to why this isn't working? Thanks

Anonymous
Not 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.

 

 

sroy_16
Resolver II
Resolver II

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.




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.