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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
cristian-ciia
Regular Visitor

How can I calculate the rolling volatility excluding blank cells?

Hello evreyone,

 

I am trying to calculate the rolling volatility (std dev) from a measure (var dia % = daily rets.). I need to know how to do this. And how to exclude the blank cells in this calculation. On the other hand, I need to know how to select the last 4 prices in the calculation of the moving average 4days. You can see below the picture and the code of the MM4.

 

Power BI Foro.JPG

 

MM4 = 
CALCULATE (
    AVERAGEX ( Precios, Precios[Valor] ),
    DATESINPERIOD (
        'Dim_Calendar DAX'[Date],
        LASTDATE ( 'Dim_Calendar DAX'[Date] ),
        -4,
        DAY
    )
)

Thank you very much!

1 REPLY 1
Anonymous
Not applicable

Hi @cristian-ciia 

Can you provide complete data? For example, what is the calculation formula for measure var dia %? What is the value of Precios[Valor]? What does your separate table involving dates look like? If possible, provide the pbix file(remove sensitive info), which will help us deal with the problem better.

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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