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
cworkman2015
Helper II
Helper II

Z Score calculating incorrectly

Hello,


I'm trying to calculate Z scores by Store with a Calendar Week Slicer. If I select a single week my z scores return correctly, however, if I default to All they inflate. 

 

Here's my formula: 

Sales Units Z Score = 
    var Mean = CALCULATE(SUMX(Values('Calendar'[Week]),[Avg Sales Units]),ALLEXCEPT('Reports DM_STORE','Reports DM_STORE'[Store Number]))
    var StandardDeviation = CALCULATE(STDEV.P('Reports FACT_SUMMARY'[SalesUnits]),ALLEXCEPT('Reports DM_STORE','Reports DM_STORE'[Store Number]))
return (SUM('Reports FACT_SUMMARY'[SalesUnits]) - Mean) / StandardDeviation

 

I tried altering hte STDEV.P formula to the STDEVX.P to iterate over the records, but it still returns the same Z Score when it's all said and done. 

 

Single Week Slicer Results:

StoreNumber: 1; Sales Units Z Score: 2

 

All Week Slicer Results: 

StoreNumber1; Sales Units Z Score: 98.64

 

 

Any idea how I can aggregate appropriately dependent on my slicer selection?

 

Any help would be appreciated!

 

Thanks,
Channing

1 REPLY 1
cworkman2015
Helper II
Helper II

bump

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.

Top Solution Authors