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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Show boxplot outliers with dynamic STDEV

Dear Power BI users,

 

I have Sales dataset consisting of (1) ProductCategory, (2) Customer, (3)NetSales, (4) Margin. Margin percentage was calculated with a calculated measure:

Margin% =DIVIDE(SUM(dataset[Margin]);SUM(dataset[NetSales]))

Based on this I made a Boxplot (Box and Whisker by MAQ Software) in order to detect outliers on Margin%.

 

Until so far this all worked out perfectly well.

 

However, next to my boxplot I also would like to put a table presenting the outlying customers per product category. As you can see I below I presented a list of all customers with their margin, but I would like to present only the outliers (note that the upper and lower whisker is on one standard deviation from the mean).

Community.PNG

 

I tried to calculate the =STDEV.P on Margin% by myself, but this wasn't possible since Margin% is a calculated measure.

 

To summarise, I would like to know how I can calculate the standard deviation on a calculated measure (which is dynamic when I use filters on year-month, productcategory, etc.).  Or does anyone know an easier way to show outliers in this case?

 

Many thanks in advance for your help!

4 REPLIES 4
MAQSupport
Solution Supplier
Solution Supplier

Hello @Anonymous,

 

You can refer to the Calculations document of Box and Whisker by MAQ software available at our GitHub page.

 

Thanks.

Anonymous
Not applicable

I already tried to calculated stdev, mean margin and subsequently tried to determine the outliers.

 

stdev = DTDEVX.P(dataset;[Margin])

mean margin = AVERAGEX(dataset;[Margin%])

outlier = IF([Margin%]<([mean margin] - [stdev]);1;0)

See below: unfortunetely the three outliers have a value of 0 instead of the desired 1.

 

The total stdev and mean margin on C are correct!

 

Community2.PNG

Hi @Anonymous,

 

Based on your image and the formulas, it seems that outliers is correct.

 

I'm a little confused about your formula about stdev = DTDEVX.P(dataset;[Margin]).

 

As I know, we should use STDEV.P(<ColumnName>)  to returns the standard deviation in Power BI. Are you sure you calculate the stdev is correct with DTDEVX.P function?

 

If it is convenient, could you share some data sample and your desired output so that we could help further on it?

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-piga-msft

 

Desired output is a matrix showing only outliers (from my boxplot).

 

Knipsel.PNG

 

Sample data:

 

ProductCategory Customer  Sales   Margin
C Customer 1  € 234,00   € 3,00
C Customer 2  € 23,00   € 1,07
C Customer 3  € 34,00   € 2,28
A Customer 1  € 47,00   € 4,49
A Customer 2  € 543,00   € 55,39
A Customer 4  € 234,00   € 25,18
A Customer 5  € 23,00   € 2,47
A Customer 6  € 34,00   € 3,66 
A Customer 7  € 47,00   € 5,11 
A Customer 2  € 543,00   € 59,73 
B Customer 8  € 98,00   € 10,82 
A Customer 2  € 633,00   € 70,39 
A Customer 9  € 38,00   € 4,27  
B Customer 8  € 84,00   € 9,44  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.