Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am attempting to construct an SPC chart in Power BI which charts Activity, Average Activity, Upper Limit (+3 stddev) and Lower limit (- 3 std dev) over time (months). For any given month, if the activity is above the upper or below the lower limit, that point on the graph needs to be a different colour. This all needs to be dynamic as the data is selected via a slicer. My issue is therefore comparing the measures (limits) with actual row values. Can anyone advise on how to achieve this ?
Many thanks
Solved! Go to Solution.
To compare the activity measure with the upper and lower limits, you can create two additional measures in your dataset for the upper and lower limits using the following DAX expressions:
Upper Limit = AVERAGE(Activity) + 3 * STDEV.P(Activity)
Lower Limit = AVERAGE(Activity) - 3 * STDEV.P(Activity)
Then, you can create a line chart visual in Power BI with months on the x-axis and activity on the y-axis. Add the Average Activity measure as a line series on the chart, and add Upper Limit and Lower Limit as additional line series.
To highlight the points above the upper limit or below the lower limit, you can use conditional formatting. Click on the visual and go to the "Visualizations" pane. Under "Data colors," select "Background color" and choose "Advanced controls." Use the following expression to define the color for the data points above the upper limit:
= IF([Activity] > [Upper Limit], "Red", "White")
Use a similar expression to define the color for data points below the lower limit:
= IF([Activity] < [Lower Limit], "Red", "White")
This will highlight any data points above or below the limits in red, while leaving the rest of the points white.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Great to hear my solution worked for you!
To compare the activity measure with the upper and lower limits, you can create two additional measures in your dataset for the upper and lower limits using the following DAX expressions:
Upper Limit = AVERAGE(Activity) + 3 * STDEV.P(Activity)
Lower Limit = AVERAGE(Activity) - 3 * STDEV.P(Activity)
Then, you can create a line chart visual in Power BI with months on the x-axis and activity on the y-axis. Add the Average Activity measure as a line series on the chart, and add Upper Limit and Lower Limit as additional line series.
To highlight the points above the upper limit or below the lower limit, you can use conditional formatting. Click on the visual and go to the "Visualizations" pane. Under "Data colors," select "Background color" and choose "Advanced controls." Use the following expression to define the color for the data points above the upper limit:
= IF([Activity] > [Upper Limit], "Red", "White")
Use a similar expression to define the color for data points below the lower limit:
= IF([Activity] < [Lower Limit], "Red", "White")
This will highlight any data points above or below the limits in red, while leaving the rest of the points white.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Isaac,
Thanks you, your explanation was perfect, though I did have an issue with using the activity for comparison but got around it by creating a measure.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |