Forum Discussion
Uzi2019
3 years agoCommunity Champion
Standard Deviation
Hi Expert, Could you please help me to compute STDEV of revenue in DAX? I am attaching below data along with how it's working in exce date source channel revenue Expected Output SD SD Formu...
- 3 years ago
Hi Uzi2019 ,
Please try:
First create an index column:
Then apply the measure:
Measure = VAR _a = STDEVX.S ( FILTER ( ALL ( 'Table' ), [Index] <= MAX ( 'Table'[Index] ) && [Index] >= MAX ( 'Table'[Index] ) - 1 ), [revenue] ) VAR _b = MINX ( ALLEXCEPT ( 'Table', 'Table'[channel] ), [date] ) RETURN IF ( MAX ( 'Table'[date] ) = _b, BLANK (), _a )Then show items with no data:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
3 years agoCommunity Champion
Uzi2019 Try something like this:
Measure =
VAR __Date = MAX('Table'[Date])
VAR __NextDate = MINX(FILTER(ALL('Table),[Date] > __Date),[Date])
VAR __CurrentValue = MAX('Table'[revenue])
VAR __NextValue = MAXX(FILTER(ALL('Table'),[Date] = __NextDate),[revenue])
VAR __Result = STDDEVX.S( { __CurrentValue, __NextValue }, [Value])
RETURN
__Result
- Uzi20193 years agoCommunity Champion
Greg_Deckler Thanks for your reply. I tried your solution but not getting expected output like I mentioned in my first post.