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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
JeremieA
Regular Visitor

Calculate stdv.p measure for a specific range of time

Hello, 

I currently use 

STDVP = STDEV.P(Table[average])
 
but Im trying to make a measure that calculate the stdv.p in the table but only for a certain period of time.

 

So I have a Table that look like this

dateaverage
2023-03-014
2023-03-025
2023-03-038
2023-03-044
2023-03-056
2023-03-069
2023-03-073
2023-03-081
2023-03-0912
2023-03-106

 

I absolutly need the whole table but if I want to calculate only for dates 2023-03-01 to 2023-03-06, how would I do that?

 

Thank you

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @JeremieA 
You can slice your measure in several ways.

For example :
You can create a calendar table

Ritaf1983_0-1691720604375.pngRitaf1983_1-1691720642696.png

Create a relationship with your data table:

Ritaf1983_2-1691720699130.png

And put the date from the calendar on your slicer

Ritaf1983_3-1691720767276.png

From this moment your measure is dynamic

Ritaf1983_4-1691720819587.png

You can download sa,ple file from here:Link 

 

More information about calendar tables is here:

https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

 

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

I found a way 

STDVMeasure = CALCULATE(
    STDEV.P(Table[average),
    DATESBETWEEN(
        Table[date],  
        date(2022,04,01),  
        date(2023,03,31)  
    )
)
 
Thanks for your time

View solution in original post

4 REPLIES 4
JeremieA
Regular Visitor

Thank you for the response, but I have to make this measure in around 50 differents, non related table in my dashboard, using a slicer would be less than optimal

Hi @JeremieA 

To be able to help, I recommend fully and clearly describing what is required and what the desired result is.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I found a way 

STDVMeasure = CALCULATE(
    STDEV.P(Table[average),
    DATESBETWEEN(
        Table[date],  
        date(2022,04,01),  
        date(2023,03,31)  
    )
)
 
Thanks for your time
Ritaf1983
Super User
Super User

Hi @JeremieA 
You can slice your measure in several ways.

For example :
You can create a calendar table

Ritaf1983_0-1691720604375.pngRitaf1983_1-1691720642696.png

Create a relationship with your data table:

Ritaf1983_2-1691720699130.png

And put the date from the calendar on your slicer

Ritaf1983_3-1691720767276.png

From this moment your measure is dynamic

Ritaf1983_4-1691720819587.png

You can download sa,ple file from here:Link 

 

More information about calendar tables is here:

https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

 

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Top Kudoed Authors