Forum Discussion

Martin_R's avatar
Martin_R
Frequent Visitor
2 years ago
Solved

How does this DAX Code work for non buying customers

Hi, I'm currently learning DAX using book the definitive guide to DAX. In the book there is a measure NonBuyingCustomers that doesn't make sense to me. Could someone explain how the variable Custo...
  • DataInsights's avatar
    2 years ago

    Martin_R,

     

    There's an error in the DAX. The variable SelectedCustomers should use Customer[CustomerKey]. It was noted in the errata (at one point all the errors were available but I'm unable to locate that list now). The link below is mentioned on page xix of the book.

     

    https://www.microsoftpressstore.com/store/definitive-guide-to-dax-business-intelligence-with-9781509306978#errata 

     

    The logic is as follows:

     

    1. Get a distinct list of all CustomerKey in the Customer dimension table, using the filter context outside the visual (i.e. filters and slicers).

     

    2. Filter the list in step 1 to include only CustomerKey not in the Sales fact table.

     

    3. Count the rows in step 2.