OpenBI Docs Buy

DETAILROWS

Returns the rows that lie behind a measure's value, as the measure's detail rows expression describes them.

A measure can carry a detail rows expression: a table expression, stored with the measure in the model, that says which rows and columns lie behind its number. A table can carry one for all its measures.

Group: Table manipulation. Compatible with DAX.

Syntax

DETAILROWS ( <Measure> )
ParameterTypeDescription
MeasureMeasureA measure of the model, in brackets.

Returns

Table. The rows behind the measure's value in the current filter context.

Remarks

  • DETAILROWS evaluates that expression with the filters in force, so the filters that shape the measure's value narrow its detail rows too.
  • When neither the measure nor its table has one, you get every row of the measure's table that the filters leave, with all its columns.
  • The argument must be a measure; an expression such as SUM ( Holdings[Nominal] ) is an error. A measure defined in the query has no detail rows expression, so it gives its table's rows.

Compared with DAX

Inside a row context, for example in ADDCOLUMNS, OpenBI applies the current row as a filter before it evaluates the detail rows. Power BI does not do so yet: wrap the call in CALCULATETABLE where a query must give the same rows in both.

Examples

A measure without a detail rows expression

No measure of the Example Brewery has one, so the result is the rows of the measure's own table, Holdings.

EVALUATE
DETAILROWS ( [Nominal held] )
ORDER BY Holdings[Bond]
Holdings[Bond]Holdings[Maturity]Holdings[Coupon]Holdings[Nominal]Holdings[Price]
Corporate 20302030-11-250.047580000000101.3
Covered 20292029-06-200.04120000000(blank)
Government 20282028-03-020.0325000000097.84
Government 20332033-03-150.022530000000092.15
Municipal 20312031-09-010.035150000000(blank)

Detail rows under a filter

EVALUATE
CALCULATETABLE ( DETAILROWS ( [Nominal held] ), Holdings[Price] > 100 )
ORDER BY Holdings[Bond]
Holdings[Bond]Holdings[Maturity]Holdings[Coupon]Holdings[Nominal]Holdings[Price]
Corporate 20302030-11-250.047580000000101.3

CALCULATETABLE, FILTER, SELECTCOLUMNS, SUMMARIZECOLUMNS.

Last updated · OpenBI Studio 0.3.74