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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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