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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Abhijeet_21
Frequent Visitor

Urgent- Need to calculate the Standard deviation within Subgroups

Hi,
How can we calculate the Standard deviation within subgroup in power bi?
The standard deviation inbuilt formulae may not work since I need to calculate the standard deviation within subgroups whereas in build formulae will give results as overall.
Thank you in advance!

3 REPLIES 3
Kishore_KVN
Solution Sage
Solution Sage

Hello @Abhijeet_21 ,

You can try below DAX Measure it may work:

SDWithinGroup = 
    CALCULATE(
        STDEVX.P(
            VALUES(Table_Name[Subgroup_Name]),
            CALCULATE(SUM(Table_Name[Value]))
        )
    )

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

Hi @Kishore_KVN ,

Thank for your quick reply!!

 

Actually I have tried your formalue, its not working and giving the expected results. let me try to explain the Standard deviation within Subgroup using simple example along with expected output. It may be helpful for you to share me Power BI solution for same.

 

Below is reference data along with output mentioned in column "Moving range". The Final output is "SD Within Subgroup value".

 

Abhijeet_21_0-1717546020162.png

 

 

Can you please share the Measure for this now?

2 Sepearate measure are also (Moving Range & SD within Subgroup) fine so that I can use in table/graphs.

 

Thanks again!

Abhijeet

Hi @Kishore_KVN ,

Thank for your quick reply!!

 

Actually I have tried your formalue, its not working and giving the expected results. let me try to explain the Standard deviation within Subgroup using simple example along with expected output. It may be helpful for you to share me Power BI solution for same.

 

Below is reference data along with output mentioned in column "Moving range". The Final output is "SD Within Subgroup value".

 

YearMonthDaySN TYPEVALUEMoving Range
2002February1A3624MIN98.0185 
2002February2A3625MIN98.01450.004
2002February2A3626MIN98.01610.0016
2002February6A3434MIN98.01930.0032
2002February6A3435MIN98.01590.0034
2002February6A3436MIN98.01620.0003
2002February6A3499MIN98.01880.0026
2002February7A3627MIN98.01940.0006
2002February8A3628MIN98.02230.0029
2002February8A3629MIN98.01950.0028
2002February9A3630MIN98.01930.0002
2002February13A3500MIN98.02130.002
2002February15A3638MIN98.01530.006
2002February16A2659MIN98.01890.0036
2002February16A3525MIN98.01740.0015
2002February16A3526MIN98.01590.0015
2002February17A3607MIN98.02130.0054
2002February19A3640MIN98.01060.0107
2002February21A3642MIN98.01670.0061
2002February21A3643MIN98.01380.0029
2002February22A3644MIN98.01490.0011
2002February22A3645MIN98.01530.0004
2002February23A3647MIN98.01710.0018
2002February23A3698MIN98.01510.002
2002February27A3646MIN98.01850.0034
2002February27A3648MIN98.01760.0009
2002February27A3649MIN98.01890.0013
2002February27A3699MIN98.02050.0016
2002February28A3637MIN98.01570.0048
2002February28A3641MIN98.01450.0012
2002February28A3650MIN98.0210.0065
2002February28A3651MIN98.02060.0004

 

Sum of Moving Range0.0867 
Average Moving Range0.002796774 
D2 (Control Chart Factor for N=2)1.128Fixed Value from Reference Table

 

SD Within Subgroup =(Average Moving Range/D2)
SD Within Subgroup value0.00247941

 

Can you please share the Measure for this now?

2 Sepearate measure are also (Moving Range & SD within Subgroup) fine so that I can use in table/graphs.

 

Thanks again!

Abhijeet

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.