SAMPLEAXISWITHLOCALMINMAX

Updated on

SAMPLEAXISWITHLOCALMINMAX is a DAX function that returns a sample subset by binning the primary X-Axis into equal-sized bins and preserving local min/max for each bin across different series.

Syntax

SAMPLEAXISWITHLOCALMINMAX(
   Size,
   Table,
   Axis,
   [ Measure, ... ],
   MinResolution,
   [ DynamicSeries, ... ],
   DynamicSeriesSelectionCriteria,
   DynamicSeriesSelectionOrder,
   MaxResolution,
   MaxDynamicSeries,
   MaxIterations
)
Argument Properties Description
Size Number of rows in the sample to be returned.
Table A table expression from which the sample is generated.
Axis The numerical Axis column from the specified table that should be binned. Each bin will preserve rows that contain min/max measure value per series.
Measure Repeatable The measure column from the specified table that should be used to determine min/max value within each bin.
MinResolution For any series, the minimum number of selected rows across the global Axis range.
DynamicSeries Optional, Repeatable The column/s from the specified table that play the role of a series.
DynamicSeriesSelectionCriteria Optional One of: NONE, ALPHABETICAL.
DynamicSeriesSelectionOrder Optional The order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending.
MaxResolution Optional For any series, the maximum number of selected rows across the global Axis range.
MaxDynamicSeries Optional The maximum number of distinct dynamic series allowed.
MaxIterations Optional For number of iterations with different bin-sizes to try in order to satisfy the desired number of requested rows.

Return Values

The sample from Table consisting of Size number of rows.

Remarks

  • If the number of rows in Table are less than the specified Size, then no binning will occur and all rows will be returned.
  • The selected bin-sizes will be less than MinResolution
  • SAMPLEAXISWITHLOCALMINMAX is used by Power BI to reduce the number of points in a line chart with a continuous (numeric) X-axis.
  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following DAX query:

EVALUATE
SAMPLEAXISWITHLOCALMINMAX(
10,
SELECTCOLUMNS ( Sales, "x", [Unit Price], "y", [Sales Amount] ),
    [x],
    [y],
10
)

Returns a 10 row (or less) sample subset of Table that is binned by Unit Price and sampled on Sales Amount.

Other functions related to SAMPLEAXISWITHLOCALMINMAX are:

Contribute » | Contributors: Rick de Groot

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy