Forum Discussion
Anonymous
3 years agoNot applicable
Including 0 values when calculating STDEV
Hi, Let me walk you through a better example. I am attempting to determine the most recent 6-Month STDEV for sales by product in order to determine variation. The Sales Data is made up of dai...
- 3 years ago
Anonymous Maybe something like this, PBIX is attached below signature. I'm not getting your stated standard deviation values but I added a debugging measure into the PBIX that should help you determine what is going on. With the debugging measure you can see that it is returning 0's for empty months.
Measure StdDev = VAR __Date = MAX('Table'[Date]) VAR __BeginDate = EOMONTH(__Date,-6) VAR __EndDate = EOMONTH(__Date, -1) VAR __Table = FILTER(ALL('Table'),[Date]>=__BeginDate && [Date]<=__EndDate) VAR __Count = COUNTROWS(__Table) VAR __Missing = 6 - __Count VAR __MissingTable = SELECTCOLUMNS( ADDCOLUMNS( GENERATESERIES(1,__Missing,1), "rmv",0 ), "rmv",[rmv], "Date",[Value] ) VAR __FinalTable = UNION(__Table, __MissingTable) VAR __Result = STDEVX.P(__FinalTable,[rmv]) RETURN __Result
Greg_Deckler
3 years agoCommunity Champion
Anonymous I didn't create a calculated table, just a measure. You can share a PBIX file on something like OneDrive or Box and post a link here.
Anonymous
3 years agoNot applicable
Hi Greg_Deckler ,
Unfortunately, I can't share my work ondrive link over here, If possible could you please use with the above pasted data.
sorry for the trouble.
Thanks
- Greg_Deckler3 years agoCommunity Champion
Anonymous The problem with what you shared is I don't see any data to take a standard deviation of. What am I missing?