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

STDEV.s for last 90 days - calculated column

Hi Experts

 

How could you calculate the STDEV,S for the last 90 days as a calculated column in power bi 

Excel formula - =STDEV.S(AW4:AW93)*SQRT(252)

 

 

BlueWhite111_0-1679609628790.png

 

1 ACCEPTED SOLUTION

FAME0 90-Day Volatility 2 = 
var current_day = BioDiesels[Date]
return
    STDEVX.S(
        FILTER(
            ALL(BioDiesels),
            BioDiesels[Date] in DATESINPERIOD(DimDate[Date], current_day, -90, DAY)
        ),
        BioDiesels[FAME0 Price Interday]
    )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
bolfri
Super User
Super User

https://dash-intel.com/powerbi/statistical_functions_stdev.php

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi bolfri. That does not work I tried it. Unless you can roof me wrong?

 

 

Boyfriend? 😂

 

Can you share sample data or something? Nameing of your calendar table? Then I can help with DAX. It's all about running -90 days on calendar to the current date on your table.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Boyfriend? - Auto correct. LOL 

1. i satrted the calculation (calculated column measure) 

FAME0 90-Day Volatility = STDEV.S(BioDiesels[FAME0 Price Interday])*SQRT(252) - wrong
 
2. i need it for last 90 days based on column..FAME0 Price Interday
 
Sample Data
 
I found this on line - this might work but not sure on how to amend the DAX
 
thanks
Link: 

FAME0 90-Day Volatility 2 = 
var current_day = BioDiesels[Date]
return
    STDEVX.S(
        FILTER(
            ALL(BioDiesels),
            BioDiesels[Date] in DATESINPERIOD(DimDate[Date], current_day, -90, DAY)
        ),
        BioDiesels[FAME0 Price Interday]
    )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi thanks for the feedback butthe expexted end result did not agree with excel

See excel 
https://www.dropbox.com/scl/fi/0jo9doga8xgdikvw46ajs/Excel-End-Result.xlsx?dl=0&rlkey=qnsm5luhd3juyu... 

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.