Skip to content

Files

Latest commit

author
Owen Duncan
Oct 18, 2018
5dbe2d6 · Oct 18, 2018

History

History
76 lines (49 loc) · 3.66 KB

aas-supplemental-lesson-detail-rows.md

File metadata and controls

76 lines (49 loc) · 3.66 KB
title description author manager ms.service ms.topic ms.date ms.author ms.reviewer
Azure Analysis Services tutorial supplemental lesson: Detail Rows | Microsoft Docs
Describes how to create a Detail Rows Expression in the Azure Analysis Services tutorial.
minewiskan
kfile
azure-analysis-services
conceptual
10/18/2018
owend
minewiskan

Supplemental lesson - Detail Rows

In this supplemental lesson, you use the DAX Editor to define a custom Detail Rows Expression. A Detail Rows Expression is a property on a measure, providing end-users more information about the aggregated results of a measure.

Estimated time to complete this lesson: 10 minutes

Prerequisites

This supplemental lesson is part of a tabular modeling tutorial. Before performing the tasks in this supplemental lesson, you should have completed all previous lessons or have a completed Adventure Works Internet Sales sample model project.

What's the issue?

Let's look at the details of the InternetTotalSales measure, before adding a Detail Rows Expression.

  1. In SSDT, click the Model menu > Analyze in Excel to open Excel and create a blank PivotTable.

  2. In PivotTable Fields, add the InternetTotalSales measure from the FactInternetSales table to Values, CalendarYear from the DimDate table to Columns, and EnglishCountryRegionName to Rows. The PivotTable now gives an aggregated results from the InternetTotalSales measure by regions and year.

    aas-lesson-detail-rows-pivottable

  3. In the PivotTable, double-click an aggregated value for a year and a region name. The value for Australia and the year 2014. A new sheet opens containing data, but not useful data.

    aas-lesson-detail-rows-pivottable

The goal here is a table containing columns and rows of data that contribute to the aggregated result of the InternetTotalSales measure. To do that, add a Detail Rows Expression as a property of the measure.

Add a Detail Rows Expression

To create a Detail Rows Expression

  1. In the FactInternetSales table's measure grid, click the InternetTotalSales measure.

  2. In Properties > Detail Rows Expression, click the editor button to open the DAX Editor.

    aas-lesson-detail-rows-ellipse

  3. In DAX Editor, enter the following expression:

    SELECTCOLUMNS(
    FactInternetSales,
    "Sales Order Number", FactInternetSales[SalesOrderNumber],
    "Customer First Name", RELATED(DimCustomer[FirstName]),
    "Customer Last Name", RELATED(DimCustomer[LastName]),
    "City", RELATED(DimGeography[City]),
    "Order Date", FactInternetSales[OrderDate],
    "Internet Total Sales", [InternetTotalSales]
    )
    
    

    This expression specifies names, columns, and measure results from the FactInternetSales table and related tables are returned when a user double-clicks an aggregated result in a PivotTable or report.

  4. Back in Excel, delete the sheet created in Step 3, then double-click an aggregated value. This time, with a Detail Rows Expression property defined for the measure, a new sheet opens containing a lot more useful data.

    aas-lesson-detail-rows-detailsheet

  5. Redeploy your model.

See also

SELECTCOLUMNS Function (DAX)
Supplemental lesson - Dynamic security
Supplemental lesson - Ragged hierarchies