Companion content

Insert your email address and press Download for access to the files used in this book.
9780735698352.zip(1.1GB)
Keep me informed about BI news and upcoming articles with a bi-weekly newsletter (uncheck if you prefer to proceed without signing up for the newsletter)

By pressing the Download button you are agree to our Privacy Policy.

Errata corrige

To ensure the ongoing accuracy of this book and its companion content, we have reviewed and confirmed the errors listed below. If you find a new oversight, please report it to us.

  • Page 10: First code block

    The first code block at page 10 should be:

    SELECT
        Customers.CustomerName,
        SUM ( Sales.SalesAmount ) AS SumOfSales
    FROM
        Sales
        LEFT JOIN Customers
            ON Sales.CustomerKey = Customers.CustomerKey 
    GROUP BY Customers.CustomerName
    
    Edited on Mar 10, 2018
  • Page 11: First code block

    The first code block at page 11 should be:

    SELECT
        Customers.CustomerName,
        SUM ( Sales.SalesAmount ) AS SumOfSales
    FROM
        Customers
        LEFT JOIN Sales
            ON Sales.CustomerKey = Customers.CustomerKey
    WHERE
        Customers.Continent = 'Europe'
    GROUP BY Customers.CustomerName 
    
    Edited on Mar 10, 2018
  • Page 59: DISTINCT can operate on a table

    The third paragraph in the page contains the following text:

    In this case, you cannot use DISTINCT over a table; in case there are duplicated rows, you do not have a single DAX function to remove duplicated rows (you have to use SUMMARIZE instead, which you will see later in Chapter 9).

    More recent versions of DAX introduced the ability to use a table as an argument of DISTINCT. Thus, the previous sentence should be changed to:

    In recent versions of DAX, you can use DISTINCT over a table. In Analysis Services 2012/2014 and Power Pivot for Excel 2013, in case there are duplicated rows, you did not have a single DAX function to remove duplicated rows (you had to use SUMMARIZE instead, which you will see later in Chapter 9).

    Edited on Oct 22, 2018
  • Page 113: Incorrect name of calculated column

    The calculated column described at the bottom of page 113 should be named SalesWithAVERAGEX instead of SalesWithSUMX.
    The right code should be the following:

    Product[SalesWithAVERAGEX] =
    AVERAGEX (
        Customer,
        CALCULATE ( SUM ( Sales[SalesAmount] ) )
    )
    
    Edited on Mar 23, 2019
  • Page 118: Code blocks and screenshot 5-17

    The first example in page 118 should have this code:

    VAR Denominator = SUMX ( Sales, Sales[Line Amount] - Sales[Line Cost] ) 
    VAR Numerator = SUM ( Sales[Line Amount] ) 
    RETURN DIVIDE ( Numerator, Denominator )
    

    The screenshot in Figure 5-17 should be captured again using all the product categories visible (no blank values).

    The second code block in page 118 and the first in page 119 should use [Sales Amount] measure instead of [SalesAmount].

    Edited on Mar 10, 2018
  • Page 127: Activation of relationships

    The example at page 127 is wrong, because the result of FILTER has the default relationship active and ignores the USERELATIONSHIP function used within CALCULATE and CALCULATETABLE.
    The right formula to achieve the result is the following:

    TotalSalesDeliveryDateIn2007 := 
    CALCULATE (
        [Sales Amount],
        USERELATIONSHIP ( Sales[DeliveryDateKey]; 'Date'[DateKey] ),
        'Date'[Calendar Year] = 2007
    )
    

    The problem of the code that does not work requires the understanding of expanded tables, described later in the book. Just ignore the example at page 127 and the last paragraph at page 126. The USERELATIONSHIP function activates the desired relationship and it works well for column filters, whereas the effect is not intuitive with table filters, which are considered as expanded tables.

    Edited on Dec 17, 2018
  • Page 136: Revenues instead of profits

    There are four instances of the word “revenues” in the page that should be replaced by “profits”.

    The three dotted lines should read:

    • Products in class A account for 70 percent of the profits.
    • Products in class B account for 20 percent of the profits.
    • Products in class C account for the remaining 10 percent of the profits.

    The last line of the last paragraph should read: them and the profits are tiny when compared with the core products.

    Edited on Mar 10, 2018
  • Page 191: First code block

    The first code block should contain the following code instead of the current one:

    FILTER (
        ALL ( 'Date'[Date] ),
        AND (
            'Date'[Date]
                > DATE ( YEAR ( MAX ( 'Date'[Date] ) )
                    - IF ( MONTH ( MAX ( 'Date'[Date] ) ) <= , 1, 0 ), ,  ),
            'Date'[Date] <= MAX ( 'Date'[Date] )
        )
    )
    
    Edited on Mar 10, 2018
  • Page 216: All code blocks until page 218

    In all the code boxes in page 216, 217, and 218, replace:

    HASONEVALUE ( 'Product Category' )
    

    with

    HASONEVALUE ( 'Product Category'[ProductCategoryKey] )
    
    Edited on Mar 10, 2018
  • Page 270: Wrong table in UNION example (1/2)

    The example at page 270 is wrong, the CALCULATETABLE function must execute ‘Product Subcategory’ at the third row instead of ‘Product Category’.
    The right code is:

    EVALUATE
    CALCULATETABLE (
        'Product Subcategory',
        UNION (
            CALCULATETABLE (
                SELECTCOLUMNS (
                    'Product Subcategory',
                    "Code 1", 'Product Subcategory'[Subcategory Code]
                ),
                'Product Subcategory'[Subcategory Code] = "0601"
                    || 'Product Subcategory'[Subcategory Code] = "0602"
            ),
            CALCULATETABLE (
                SELECTCOLUMNS (
                    'Product Subcategory',
                    "Code 2", 'Product Subcategory'[Subcategory Code]
                ),
                'Product Subcategory'[Subcategory Code] = "0702"
            )
        )
    )
    

    The result displayed at page 271 should include rows from the Product Subcategory table, too:

    ProductSubcategoryKey Subcategory Code Subcategory ProductCategoryKey
    34 0601 Music CD 6
    35 0602 Movie DVD 6
    39 0702 Download Games 7
    Edited on Aug 29, 2018
  • Page 271: Wrong table in UNION example (2/2)

    The example at page 272 is wrong, the CALCULATETABLE function must execute ‘Product Subcategory’ at the third row instead of ‘Product Category’.
    The right code is:

    EVALUATE
    CALCULATETABLE (
        'Product Subcategory',
        UNION (
            CALCULATETABLE (
                SELECTCOLUMNS (
                    'Product Subcategory',
                    "Code 1", 'Product Subcategory'[Subcategory Code]
                ),
                'Product Subcategory'[ProductCategoryKey] = 6
            ),
            ROW ( "Code 2", "0702" )
        )
    )
    

    The result displayed at page 271 should include rows from the Product Subcategory table, too:

    ProductSubcategoryKey Subcategory Code Subcategory ProductCategoryKey
    1 0101 MP4-MP3 1
    2 0102 Recorder 1
    3 0103 Radio 1
    Edited on Aug 29, 2018
  • Page 370: PriceRange calculated column

    The PriceRange calculated column must use ISBLANK instead of ISEMPTY, resulting in the following code:

    Sales[PriceRange] =
    VAR ResultValue =
        CALCULATE (
            IFERROR (
                VALUES ( PriceRanges[PriceRange] ),
                "Overlapping Configuration"
            ),
            FILTER (
                PriceRanges,
                AND (
                    PriceRanges[MinPrice ]  <= Sales[Net Price],
                    PriceRanges[MaxPrice ]  > Sales[Net Price]
                )
            )
        )
    RETURN
        IF (
              ISBLANK ( ResultValue ), 
              "Holes in Configuration",
              ResultValue
        )
    
    Edited on Mar 10, 2018
  • Page 377: Promotion P2 in February and not in January

    The paragraph before Table 12-1 contains “whereas P2 is in promotion B only in February” whereas it should be “whereas P2 is in promotion B only in January”

    The second-last paragraph contains “This is because P2, in January, was not present in any promotion.” whereas It should be “This is because P2, in February, was not present in any promotion.”

    Edited on Mar 14, 2018