Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
scott3387
Frequent Visitor

Dynamic Standard Deviation for control charts.

Hello,

 

I'm pretty new to Power BI so please forgive me if this is trivial or unnesscarly complicated.

 

I have data stored like this...

 

Event DateModalityUpdatedTextSuspected referralExams
01/11/2018CT03 - Suspected lung cancer2
01/11/2018CT06 - Suspected upper gastrointestinal cancers2
01/11/2018CT07 - Suspected lower gastrointestinal cancers14
01/11/2018CT11 - Suspected urological cancers (excluding testicular)2
01/11/2018Mammography01 - Suspected breast cancer21
01/11/2018Mammography16 - Exhibited (non-cancer) breast symptoms - cancer not initially suspected5
01/11/2018MRI04 - Suspected haematological malignancies excluding acute leukaemia2
01/11/2018MRI11 - Suspected urological cancers (excluding testicular)1
01/11/2018MRI13 - Suspected head & neck cancers3
01/11/2018MRI 1
02/11/2018CT01 - Suspected breast cancer3
02/11/2018CT06 - Suspected upper gastrointestinal cancers2

 

I'm trying to create report that would allow the user to generate SPC (control) charts. This chart would change automatically based on  the slicers selected. These slicers would be date, referral type or modality.

 

A SPC Chart has the total as a line and 3 constant lines:

  • Mean
  • Upper limit (mean + 3 SD)
  • Lower limit (mean - 3 SD)

Basically it's just a line chart with 3 straight lines on it. However I would like these lines to change to show only data that has been selected via slicers.

 

I figured out a mean could be created by making a measure with the formula below and dragging it to the chart.

 

CALCULATE ( SUM ( exams[Exams] ), ALLSELECTED( exams ) )
/ CALCULATE ( DISTINCTCOUNT ( exams[Event Date] ), allselected( exams ) )
 
I tried to do the same with a standard dev measure (and then using this is product the limits) as below but this does not work.
 
CALCULATE( STDEV.s(exams[Exams]), allselected(exams[Event Date]) )

I think it's taking every line seperately and calculating the std dev from that but I want the std dev of the sum of exams per day, not per line.
 
Hopefully that's not too confusing. Thanks in advance for any advice. 
 
 
1 REPLY 1
v-xicai
Community Support
Community Support

Hi @scott3387 ,

 

>>I think it's taking every line seperately and calculating the std dev from that but I want the std dev of the sum of exams per day, not per line.

 

I am not sure what desired result would you want, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.