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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.