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
BobKoenen
Helper IV
Helper IV

Average Standard deviation calculated per month

Hi I want to calculate a montly standard deviation 

I want to calculate the standard devation in DAX from my fact table but not the SD per row but totalled per month. 
My data looks like this 

CustomerdateSales
A1-1-202320
A15-1-202350
A5-2-202310
A10-3-2023150
1-1-202350
B5-3-2023

1

 

Now I want a DAx formula which first calculates the total sales per month. e.g. for customer A see below and after that calculates the standard deviation per month. 

 

CustomerMonthSales
A1-202370
A2-202310
A3-2023150

 

If i would calculate the st dev using 

STDEV.P(Tabel[Sales])  this gives me 57.35 which is correct. How can i build this logic in to a dax formula

hope you can help me
2 REPLIES 2
eliasayyy
Super User
Super User

if you want the sum of sales for each month alone, try using 

 

SUMX(values([Month-Year]),[sales measure])

 

or

 

CALCULATE(SUM([Amount]),ALLEXCEPT(Table,[Month-Year],[Category]))

 


this will give you sum of sales by month - year use the first if you dont have ctageories an dsub categories and use the second if you have categories and sub categories

 

some_bih
Super User
Super User

Hi @BobKoenen try measure 

STDEVX.P(Sheet29,Sheet29[Sales])
Sheet29 adjust to your table name
Connect date column with Date table and check results. You provided sample of data so it is hard to check if it is ok. I hope this help




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

Proud to be a Super User!






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.