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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Plot multiple years data on one chart

Probably a rookie question, but here goes:

 

I have multiple years of company order data, and I am trying to plot each year of data overlayed ontop of each other for comparison (eg idea was that x-axis on chart shows week01 through to week52, chart legend would be year )

 

I have a date table (dimTime) that includes :

FullDate          Week        FullDate (Weekly)    Year

01/04/2018     Week01    01/04/2018              2018

02/04/2018     Week01    01/04/2018              2018

03/04/2018     Week01    01/04/2018              2018

04/04/2018     Week01    01/04/2018              2018

05/04/2018     Week01    01/04/2018              2018

06/04/2018     Week01    01/04/2018              2018

07/04/2018     Week01    01/04/2018              2018

08/04/2018     Week02    08/04/2018              2018

09/04/2018     Week02    08/04/2018              2018

 

The week number rotates at Week52 back to Week01. FullDate (Weekly) is a group created from the Full Date column.

 

I have a seperate table contining multiple years of order intake data (with a measure OrdersSum) and in that table I have a measure calculating "rolling 91 day order intake average". 

 

TestMovingAverageOrders =
VAR TestMAOrders = CALCULATE(AVERAGEX( VALUES( dimTime[fulldate (Weekly)] ), [OrdersSum] ),
      DATESINPERIOD( dimTime[fulldate (Weekly)], MAX( dimTime[fulldate (Weekly)] ), -91,DAY ) )
Return TestMAOrders

 

If I plot the above or create a table with the above against "fulldate (Weekly)" the rolling average values look fine.

 

However if I plot multiple years of data using "fulldate (Weekly)" as the x-axis then obviously the multiple years of data are plotted sequentially along the axis. What I want is to be able to plot each years data overlayed ontop of eachother so that I can compare year on year. So I thought I would simply swap the x-axis to be the Week number column (eg Week01), however when I do this the moving average calculation changes and what is displayed is the most recent order value for each week.

 

If any one can provide any help for me to understand why changing the chart axis from the "fulldate (Weekly)" group column to the Week number column changes the calculated values, it would be much appreciated. Also if anyone can advise what the solution to the above might be it would be even better.

 

Cheers,

Michael.

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Use Year in your Legend?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Many thanks for the quick response Greg.

 

If I put the year as a legend it does indeed plot each year as an individual series, each with its own colour. However each year is not plotted ontop of each other (with a x-axis of Week01 to Week52 or something equivalent), the series are plotted end to end with an x-axis scale of 2015 to 2018.

 

I have the "Week01" to "Week52" column in my date table, but when I try to plot against this scale it corrupts the moving average calculation and what gets plotted (or displayed in a table) is the last sum of orders for each week. 

 

Cheers,

 

MIchael.

Anonymous
Not applicable

Also just noticed that if I plot the years as seperate series (years as legend) then the 91 day moving average calculation doesnt work for the first 91 days as it treats the prior years data as a different set.

 

Is there any way the moving average can be continuous but each years data is plotted on top of each other? 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors