SKEWX.S OpenBI
How lopsided an expression's results over a table's rows are, taken as a sample: the sample skewness.
Skewness says which way the values lean: 0 for a symmetric spread, positive when a few large values make a long tail to the right (most order sizes, most prices), negative for a long tail to the left.
Group: Aggregation. OpenBI’s own: DAX has no function of this name.
Syntax
SKEWX.S ( <table>, <expression> )
| Parameter | Type | Description |
|---|---|---|
table | Table | The rows to go through. |
expression | Expression evaluated for each row | The number worked out for each row. |
Returns
Number. The sample skewness of the results; BLANK for fewer than three, or when they are all equal.
Remarks
- The sample skewness, the one Excel's
SKEWgives: the population's skewness (SKEW.P) times √(n (n − 1)) ÷ (n − 2), for n values. The factor makes up for a small sample, and comes close to 1 as n grows. - Rows where the expression is blank are left out; fewer than three results, or results that are all the same, give BLANK.
Compared with DAX
An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.
Excel's SKEW gives the same number for the same values.
Examples
Eight values as a sample and as all there is
EVALUATE
ROW (
"Sample", SKEWX.S ( DATATABLE ( "Value", INTEGER, { { 2 }, { 4 }, { 4 }, { 4 }, { 5 }, { 5 }, { 7 }, { 9 } } ), [Value] ),
"Population", SKEWX.P ( DATATABLE ( "Value", INTEGER, { { 2 }, { 4 }, { 4 }, { 4 }, { 5 }, { 5 }, { 7 }, { 9 } } ), [Value] )
)
| Sample | Population |
|---|---|
| 0.8184875533568 | 0.65625 |
Monthly liters of each product
Does a product sell steadily, or have a few big months?
EVALUATE
SUMMARIZECOLUMNS (
Products[Product],
"Skewness", SKEWX.S ( VALUES ( Sales[Month] ), [Liters sold] )
)
ORDER BY Products[Product]
| Products[Product] | Skewness |
|---|---|
| Cider | 1.03339422943615 |
| IPA | 1.12590261306853 |
| Lettøl | 1.04607250801285 |
| Pils | 0.69242293609049 |
A blank row is left out
EVALUATE
ROW (
"With a blank", SKEWX.S ( DATATABLE ( "Value", INTEGER, { { 1 }, { 2 }, { BLANK () }, { 10 } } ), [Value] ),
"Without", SKEWX.S ( DATATABLE ( "Value", INTEGER, { { 1 }, { 2 }, { 10 } } ), [Value] )
)
| With a blank | Without |
|---|---|
| 1.65231674033299 | 1.65231674033299 |