 Six Sigma Control Charts in Power BI - Excelerator BI

# Six Sigma Control Charts in Power BI

Level: Intermediate

I have had a couple of requests for help during my live training classes and online training classes on how to build a Six Sigma Control Chart.  Now I am not professing to be a Six Sigma black belt, but I do know how to write DAX and I do know how to use Power BI.  So here goes.  This is what I am going to build. ## The Method

As usual, I used the Adventure Works database in this article. I then used DAX formulas and Power BI visuals to arrive at this six sigma chart. Here are the steps I followed to produce the result.

1. I created a DAX formula for total sales.

`Total Sales = SUM(Sales[ExtendedAmount])`

2. Then I created a DAX formula to obtain the mean (average) of the sales by day.

```Average Sales =
CALCULATE(
AVERAGEX('Calendar', [Total Sales]),
ALLSELECTED('Calendar')
)```

Note that I used AVERAGEX function iterating over the Calendar table in order to get the average sales over the selected days instead of the average per transaction.

3. Next I calculated the LCL and UCL by adding/subtracting one standard deviation, as follows.

```Std Dev =
CALCULATE(
STDEVX.P('Calendar', [Total Sales]),
ALLSELECTED('Calendar')
)```
` = [Average Sales] - [Std Dev]`
` = [Average Sales] + [Std Dev]`

4. I then created a combo chart – the lines show the average and control limits (LCL and UCL) and the columns show the total sales values. I used a slicer to filter the time period.

The idea is to create an interactive dynamic chart that displays sales distribution over the selected time period. The part of the columns below LCL, above UCL, and between LCL and UCL are to be displayed with different colours. To get this, I had segmented the columns with the following DAX formulas.

`Part Lower Bar = IF([Total Sales] < [LCL], [Total Sales])`
`Full Lower = IF([Total Sales] >= [LCL], [LCL])`
```Middle =
IF(
[Total Sales] > [LCL] && [Total Sales] <= [UCL],
[Total Sales] - [LCL],
IF([Total Sales] > [LCL], [UCL] - [LCL])
)```
`Upper = IF([Total Sales] > [UCL], [Total Sales] - [UCL])`

To understand how I arrived at each of these DAX formulas that resulted in the interactive six sigma control chart as given at the beginning of this article, view the video below.

And, here is the sample file that is used. ### 17 thoughts on “Six Sigma Control Charts in Power BI”

1. Matt, Really nice video and very helpful I am still unable to gather the concept per. my requirements. Will you be able to share the Power BI file so I can understand in more details how the control charts were created?

2. Whilst this is a really nice looking demo, it sort of undermines the whole principle of control charts. The concept is that we ‘set’ control ‘limits’ and leave them, until signals in the data (trends) indicate that investigation should take place. Because the limits are set based on historical data, they indicate a level of process predictability.

If these limits can move based on date they fundamentally contradict the concept of ‘control’ limits – you want them set, not moving and only change them based on triggers from your data. I believe this is one of the fundamental reasons people have issues with control charts

3. Thank you!!

4. Marvin Dayrit Villareal

Amazing!

5. Marvin Dayrit Villareal

Amazing!

6. Nifty, thanks.

7. Nifty, thanks.

8. This would not be considered an acceptable method of creating control limits for an x bar chart. Nor would the use of a bar chart be a good choice for identifying trends and assignables causes that’s aren’t single movements beyond the control limits (something that’s going to happen quite regularly with a 1s limit).

9. This would not be considered an acceptable method of creating control limits for an x bar chart. Nor would the use of a bar chart be a good choice for identifying trends and assignables causes that’s aren’t single movements beyond the control limits (something that’s going to happen quite regularly with a 1s limit).

10. Very interesting. thanks Matt

11. Very interesting. thanks Matt

12. This will be useful in testing boundaries of inventory levels.
I’ll give it a try. Thanks Matt.

13. This will be useful in testing boundaries of inventory levels.
I’ll give it a try. Thanks Matt.

14. Very clever. The average sales over selected time calculation is an often used formula for many business scenarios. I’ve seen it more usually applied with percentage growth/decline calculations to identify entities that are above the average and those that pull the average down (and require further attention).

15. Very clever. The average sales over selected time calculation is an often used formula for many business scenarios. I’ve seen it more usually applied with percentage growth/decline calculations to identify entities that are above the average and those that pull the average down (and require further attention).

Scroll to Top