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
Anonymous
Not applicable

calculate mean and standard deviate except last weeks

Hi All,

 

I'm trying to calculate the mean and standard deviation for 12 weeks and my dataset has 13 weeks of data. This is for the purpose of calculating the z value. Following are the measures I tried;

 

Mean = VAR maxweek = MAX('Last 13 weeks New'[WeekOfYear]) RETURN CALCULATE(AVERAGE('Last 13 weeks New'[#_Cases]),'Last 13 weeks New'[WeekOfYear]<maxweek)
 
The result of this is 1 for each row
 
Standard deviation new = VAR maxweek = MAX('Last 13 weeks New'[WeekOfYear]) RETURN CALCULATE(STDEV.P('Last 13 weeks New'[#_Cases]),'Last 13 weeks New'[WeekOfYear]<maxweek)
 
The result of this is 0 for each row
 
WeekOfYear is a whole number
 
Any help on above is much appreciated,
 
Thanks in advance,
 
Best Regards,
Ashan Meegoda.
1 REPLY 1
Anonymous
Not applicable

Hello @Anonymous 
Can you please provide some sample data in table format with the expected output after removing sensitive information?
Please check this link 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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