Forum Discussion
jmg80525
Helper II
2 years agoGroup By Standard Deviation not working as expected. Returns 0 for values w/ variance
Lot's of solved threads that suggest using List.StandardDeviation to group value on SD. Seem easy enough. Below is a filterd set of values that clear have variance. I run Transform>Statist...
sevenhills
Super User
2 years agoI think this line of code is wrong...
{"LDSegmentIntID", "TopOfHourCentral"}, {{"SDHrValue", each List.StandardDeviation([LDSegmentIntID])
Here, you are grouping by "LDSegmentIntID", "TopOfHourCentral" and trying to get the same standard deviation for the "LDSegmentIntID". Which does not make sense. You need to use the column that you are calculating standard deviation for.
#"Grouped Rows" = Table.Group(#"Changed Type", {"LDSegmentIntID", "TopOfHourCentral"}, {{"SDHrValue"}, each List.StandardDeviation([?? Value column]), type number}})
For definition, refer to this: https://learn.microsoft.com/en-us/powerquery-m/list-standarddeviation
Post the code and sample of data and what you are expecting. (after removing sensitive info).