cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LikhithaVG123
Helper III
Helper III

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 @LikhithaVG123 ,

 

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 @LikhithaVG123 ,

 

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. 

LikhithaVG123
Helper III
Helper III

Any solution please?

Thanks

Hi,

Any suggestions please ?

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors