Forum Discussion
Calculate Standard deviation from a measure
- 5 years ago
Hi Anonymous ,
Since you are using the iterator function STDEVX.P, you can refer to this post to understand the context in the iterator function.
If you want to calculate the standard deviation for different periods and different stores, you can use the following formula.Measure = IF( ISFILTERED('ssc_db_001 ga_incident_report'[Period]), STDEVX.P( VALUES('ssc_db_001 ga_incident_report'[Incident type]), CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) ) ), IF( ISFILTERED('ssc_db_001 ga_incident_report'[Store name]), STDEVX.P( VALUES('ssc_db_001 ga_incident_report'[Period]), CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) ) ), STDEVX.P( VALUES('ssc_db_001 ga_incident_report'[Store name]), CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) ) ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Greg,
Thank you for your response. I have addapted the measure however I am still getting the same results- Obviously I am going wrong somehwere but I am unsure where.
Any further guidance would be great!
Thank you for your time & help!
Hi Anonymous ,
Since you are using the iterator function STDEVX.P, you can refer to this post to understand the context in the iterator function.
If you want to calculate the standard deviation for different periods and different stores, you can use the following formula.
Measure =
IF(
ISFILTERED('ssc_db_001 ga_incident_report'[Period]),
STDEVX.P(
VALUES('ssc_db_001 ga_incident_report'[Incident type]),
CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) )
),
IF(
ISFILTERED('ssc_db_001 ga_incident_report'[Store name]),
STDEVX.P(
VALUES('ssc_db_001 ga_incident_report'[Period]),
CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) )
),
STDEVX.P(
VALUES('ssc_db_001 ga_incident_report'[Store name]),
CALCULATE( COUNTA('ssc_db_001 ga_incident_report'[id]) )
)
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.