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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
brickanalyst
Resolver I
Resolver I

How can I find out why standard deviation measure doesn't work?

Hello Everyone, 
 
 

I have 3 tables and appended on the top of each other. Each table I can identify with table_type column, so that I can use necessary aggregations by filtering them. They have attribute and value column so I can fetch the data in dax (please see below)

VAR _table =
    ADDCOLUMNS(
        'Appended Table',
        "IsNumeric"IFISERRORVALUE('Appended Table'[Value]) ), 0VALUE('Appended Table'[Value]) ),
        "Table Type", 'Appended Table'[Table_Type],
        "UID", 'Appended Table'[Attribute]
    )
VAR _measure = STDEVX.P(
                    FILTER(_table, [Table Type]= "My Table"),
                    [IsNumeric]
                )
RETURN _measure

 

okay I realize it works when I filter one category which values are 

0.170289855 and 0.239130435 and their standard deviation is 3.44%

 

and when I filter another category which values are 

0
0.006122449
0.020408163
-0.037037037
-0.048247999
-0.092592593
-0.100040016
-0.123193614
-0.145365551
0.183673469
-0.195918367
0.285714286
0.287504476
-0.306122449
-0.322942857
0.36122449
-0.413793103
-0.624752187

and measure returns = 6.05% however when I look at excel and calculated std.p = 24.68%

 

I need to figure it out somehow... Since I'm sure I'm working on the right selected (filtered data) and not able to dissect the formula and try to replicate step by step... 

I need your help= any ideas, directions will be much appreciated.
thank you !

3 REPLIES 3
brickanalyst
Resolver I
Resolver I

@Sahir_Maharaj 

Hey Sahir, Thank you for reaching out! 
I used your measure on my report, it returns the same records with the measure I shared...

There is one thing I'm CERTAIN
If we don't have any negative values => Std deviation WORKS
If we have one single negative value=> It doesn't

For your information @Anonymous 

Anonymous
Not applicable

Hi @brickanalyst ,

 

I'm checking how the things are going on about this issue. Whether the Sahir_Maharaj's answer helps you?

 

If you find any answer is helpful to you, please remember to accept it.

 

It will help others who meet the similar question in this forum.

 

If there is any problem, please feel free to let us know.

 

Thank you for your understanding!

 

Sahir_Maharaj
Super User
Super User

Hello @brickanalyst,

 

Can you please try the following approach:

VAR SelectedTable =
    FILTER(
        ADDCOLUMNS(
            'Appended Table',
            "IsNumeric", IF( ISERROR( VALUE('Appended Table'[Value]) ), BLANK(), VALUE('Appended Table'[Value]) )
        ),
        [Table Type] = "My Table" && NOT(ISBLANK([IsNumeric]))
    )

VAR MeanValue =
    AVERAGEX(SelectedTable, [IsNumeric])

VAR VarianceValue =
    AVERAGEX(SelectedTable, ([IsNumeric] - MeanValue) * ([IsNumeric] - MeanValue))

VAR StdDeviation =
    SQRT(VarianceValue)

RETURN StdDeviation

Hope this helps!


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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