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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KJanssens
Helper II
Helper II

Standard deviation of rolling sum of sales of product

My data consists of historical quantities sold each day of each product.

I have already calculated the rolling sum of products sold in a period, currently 30 days.

 

Measure 1:=CALCULATE(SUM([qty]); DATESINPERIOD('Calendar'[Date]; LASTDATE('Calendar'[Date]); -30; DAY))

 

Using this rolling sum, I want to detect products that are "Seasonal" products, where there are significant peaks in the rolling sum of quantity sold, versus "non-seasonal" products (where the rolling sum of the quantity of products sold is quite steady).

I am not a statistician, but I think I can use the standard deviation of this rolling sum for each product to detect products with peaks in its sales...

Any idea how I can do this in DAX?

Thanks,

Koen

 

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @KJanssens 

 

Try the below DAX functions.

STDEV.P Returns the standard deviation of the entire population.
STDEV.S Returns the standard deviation of a sample population.
STDEVX.P Returns the standard deviation of the entire population.
STDEVX.S Returns the standard deviation of a sample population.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

Hi @Mariusz ,

I know these functions, but it seems I cannot just use it on the first measure:

Measure 2:= STDEV.P([Measure 1])

Any idea how I can do this?

 

 

Hi @KJanssens 

 

The argument that is expected is Column not Measure.

You can try using STDEVX.P this will allow you to pass a Measure as a second Argument

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors