Forum Discussion
How does this DAX Code work for non buying customers
- 2 years ago
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.
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.
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.
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.
Thank you Data Insights. I found the errata page here.
https://www.sqlbi.com/books/the-definitive-guide-to-dax-2nd-edition/companion/