Forum Discussion
Average on a calculated sum
- 4 years ago
Anonymous,
Try these measures:
Sum Cycle Time = SUMX ( VALUES ( Table1[QUOTE_ID] ), CALCULATE ( SUM ( Table1[Cycle Time] ) ) )Average Cycle Time = VAR vAvg = AVERAGEX ( VALUES ( Table1[QUOTE_ID] ), [Sum Cycle Time] ) VAR vResult = IF ( NOT HASONEVALUE ( Table1[QUOTE_ID] ), vAvg ) RETURN vResult - 4 years ago
Anonymous,
Try these measures:
Sum Cycle Time = SUM ('CPQ Negotiating'[Cycle Time] ) Mean = CALCULATE ( AVERAGEX ( VALUES ( 'CPQ Negotiating'[QUOTE_ID] ), [Sum Cycle Time] ), ALLSELECTED ( 'CPQ Negotiating'[QUOTE_ID] ) ) Std Dev = CALCULATE ( STDEVX.P ( VALUES ( 'CPQ Negotiating'[QUOTE_ID] ), [Sum Cycle Time] ), ALLSELECTED ( 'CPQ Negotiating'[QUOTE_ID] ) ) Z-Score = DIVIDE ( [Sum Cycle Time] - [Mean], [Std Dev] )I manually entered the first two QUOTE_ID, so Mean, Std Dev, and Z-Score are different from yours. Let me know the result with your full data set.
Anonymous,
Would you be able to provide the expected result, along with the calculation logic?
Ultimately what I am trying to do is a Z-score based on the summed values so:
Raw data
This is what I am trying to do:
So the mean is based on the average of the summed amounts, the standard deviation also goes against the sum of the cycle time.
- DataInsights4 years ago
Super User
Anonymous,
Try these measures:
Sum Cycle Time = SUM ('CPQ Negotiating'[Cycle Time] ) Mean = CALCULATE ( AVERAGEX ( VALUES ( 'CPQ Negotiating'[QUOTE_ID] ), [Sum Cycle Time] ), ALLSELECTED ( 'CPQ Negotiating'[QUOTE_ID] ) ) Std Dev = CALCULATE ( STDEVX.P ( VALUES ( 'CPQ Negotiating'[QUOTE_ID] ), [Sum Cycle Time] ), ALLSELECTED ( 'CPQ Negotiating'[QUOTE_ID] ) ) Z-Score = DIVIDE ( [Sum Cycle Time] - [Mean], [Std Dev] )I manually entered the first two QUOTE_ID, so Mean, Std Dev, and Z-Score are different from yours. Let me know the result with your full data set.
- Anonymous4 years agoNot applicable
Thank you so much for your help. I had to modify the ALLSELECTED to include some additional columns that are included within the data set but this worked perfectly.