Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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).
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!
Hello @Anonymous,
You can refer to the Calculations document of Box and Whisker by MAQ software available at our GitHub page.
Thanks.
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!
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
Hi @v-piga-msft
Desired output is a matrix showing only outliers (from my boxplot).
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |