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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
HH_95
Frequent Visitor

Creating a process control chart that calculates average, LCL and UCL for the previous year

Hi,

 

I have data that counts the number of jobs raised per week since 2019.

 

I would like to build a process control chart that calculates the average, UCL and LCL values for the previous year to the data that is being presented e.g: 2020 control values for the 2021 data and 2019 values for the 2020 data.

A slicer will be required to filter between current and previous year(s). The data source is an excel file that is usually updated daily.

 

HH_95_0-1637584389660.png

This is what I've created so far but this calculates the control values from the same year as the data rather than the previous year but this is the format I would like.

 

I've even tried creating two different line charts, one for the control values and the other for the data, and then tried to overlay them but can't seem to get the scales to fit. This allows me to choose the year for both the control values and actual data. See below.

 

HH_95_1-1637584595869.png

 

 

Week commencingCount of jobs

29 July 201915
05 August 201911
12 August 201934
19 August 20197
26 August 20194
02 September 20196
09 September 201915
16 September 20193
23 September 20196
30 September 20197
07 October 20193
14 October 20192
21 October 20194
28 October 201912
04 November 20194
18 November 201917
25 November 20198
02 December 20193
09 December 20195
16 December 20194
23 December 20191
30 December 20195
06 January 202010
13 January 202010
20 January 20205
27 January 20206
03 February 202010
10 February 202023
17 February 202030
24 February 202014
02 March 202012
09 March 20206
16 March 202012
23 March 20202
30 March 202012
06 April 20208
13 April 20204
20 April 20204
27 April 202010
04 May 202012
11 May 202013
18 May 20209
25 May 202013
01 June 202010
08 June 202011
15 June 202010
22 June 202024
29 June 202016
06 July 202017
13 July 202010
20 July 202011
27 July 20204
03 August 202011
10 August 202012
17 August 202012
24 August 202013
31 August 20209
07 September 20206
14 September 202018
21 September 20207
28 September 202019
05 October 202016
12 October 20209
19 October 202010
26 October 20209
02 November 202015
09 November 202011
16 November 202017
23 November 202010
30 November 20209
07 December 20207
14 December 202014
21 December 202011
28 December 202014
04 January 202111
11 January 202114
18 January 202122
25 January 202131
01 February 202123
08 February 202122
15 February 202123
22 February 202126
01 March 202113
08 March 202123
15 March 202131
22 March 202124
29 March 202123
05 April 202120
12 April 202125
19 April 202121
26 April 202122
03 May 202122
10 May 202121
17 May 202121
24 May 202132
31 May 202122
07 June 202132
14 June 202129
21 June 202112
28 June 202120
05 July 202120
12 July 202116
19 July 202115
26 July 202120
02 August 202132
09 August 202122
16 August 202124
23 August 202121
30 August 202125
06 September 202120
13 September 202131
20 September 202115
27 September 202135
04 October 202135
11 October 202125
18 October 202141
25 October 202128
01 November 202128
08 November 202126
BLANK1046700
15 November 202129

 

 

Thanks

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HH_95 , You need Max or Min based on some group by like week or Job ID,

Use first one when you date, with date table. Second you can use with year too

 

Last YTD Max = CALCULATE(Minx(Values(Job[ID]),[Week commencing]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

 

Last Year Max = CALCULATE(Maxx(Values(Job[ID]),[Week commencing]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@HH_95 , You need Max or Min based on some group by like week or Job ID,

Use first one when you date, with date table. Second you can use with year too

 

Last YTD Max = CALCULATE(Minx(Values(Job[ID]),[Week commencing]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

 

Last Year Max = CALCULATE(Maxx(Values(Job[ID]),[Week commencing]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors