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.
v-jianboli-msft
3 years agoCommunity Support
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.
Uzi2019
3 years agoCommunity Champion
Thanks alot. It worked for me.