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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Standard deviation in powebi dax

Hi, 
I have a requirement to calculate the Standard devitation of a calculated measure
1) calculate the MoM% for all records
2) calculate the standard devation of calculated MoM%
3) multiply the standard deviation with the quare root of the number of rows selected


MOM % - 

LikhithaVG123_1-1683271801033.png

Standarad Deviation

LikhithaVG123_2-1683271848349.png

DateHIGH SIDE% MoM
Mar 2021800 
Apr 20218304%
May 20218300%
Jun 20218300%
Jul 20218300%
Aug 20218806%
Sep 20218800%
Oct 20218800%
Nov 20218800%
Dec 20218800%

Can someone please hep me on this. i am unable to find the solution

 

Thanks

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create calculated columns.

Mom % = 
var _a=CALCULATE(MAX('Table'[HIGH SIDE]),FILTER('Table',EDATE('Table'[Date],0)=EDATE(EARLIER('Table'[Date]),-1)))
var _b='Table'[HIGH SIDE]
return 
IF(_a=BLANK(),BLANK(),_b/_a-1)
Standard Deviation = STDEVX.S(FILTER('Table','Table'[Date]>='Table (2)'[from] && 'Table'[Date]<='Table (2)'[to]),'Table'[Mom %])
Volatility Index = SQRT(COUNTROWS(FILTER('Table','Table'[Date]>='Table (2)'[from] && 'Table'[Date]<='Table (2)'[to])))*'Table (2)'[Standard Deviation]

(3) Then the result is as follows.

vtangjiemsft_0-1683622497131.pngvtangjiemsft_1-1683622506751.png

Please refer to the following documents for more information.

STDEVX.S function (DAX) - DAX | Microsoft Learn

SQRT function (DAX) - DAX | Microsoft Learn

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

3 REPLIES 3
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create calculated columns.

Mom % = 
var _a=CALCULATE(MAX('Table'[HIGH SIDE]),FILTER('Table',EDATE('Table'[Date],0)=EDATE(EARLIER('Table'[Date]),-1)))
var _b='Table'[HIGH SIDE]
return 
IF(_a=BLANK(),BLANK(),_b/_a-1)
Standard Deviation = STDEVX.S(FILTER('Table','Table'[Date]>='Table (2)'[from] && 'Table'[Date]<='Table (2)'[to]),'Table'[Mom %])
Volatility Index = SQRT(COUNTROWS(FILTER('Table','Table'[Date]>='Table (2)'[from] && 'Table'[Date]<='Table (2)'[to])))*'Table (2)'[Standard Deviation]

(3) Then the result is as follows.

vtangjiemsft_0-1683622497131.pngvtangjiemsft_1-1683622506751.png

Please refer to the following documents for more information.

STDEVX.S function (DAX) - DAX | Microsoft Learn

SQRT function (DAX) - DAX | Microsoft Learn

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Anonymous
Not applicable

Any solution please?

Thanks

Anonymous
Not applicable

Hi,

Any suggestions please ?

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors