A pattern is a general, reusable solution to a frequent or common challenge.
This book is the second edition of the most comprehensive collection of ready-to-use solutions in DAX, that you can use in Microsoft Power BI, Analysis Services Tabular, and Power Pivot for Excel.
In this new edition we made several choices:
- We greatly increased the share of the book dedicated to time intelligence calculations. Time intelligence is by far the most widely studied topic. Therefore, it made sense to increase the number of time-related calculations and patterns.
- Similarly, the New and returning customers pattern was an absolute hit. We gave that pattern a bigger share of the book as well, increasing the number of formulas and models to compute new and returning customers.
- We increased the number of patterns, adding several that – in our experience – are likely to be useful to our readers.
- We decided to cut out a few patterns. For example, the chapter about statistical calculations was useful back in 2015, because of the lack of statistical functions in DAX. Since then, DAX introduced many new functions to compute the formulas that were explained in that chapter. There is no need for that content in 2020.
- We no longer provide code snippets. In the previous book, most of the code was shown including placeholders for the columns that readers were likely to change. We no longer do that. We show code that works, because you often have to adapt the data model and other details in the formula. We felt this would make the code more readable and easier to use and to adapt to your model.
- We optimized every single formula. All the code you see in these patterns has been thoroughly reviewed for performance. This is not to say that these patterns are the very best. They are the best we could come up with. If you can make the code better and faster, let us know! The comment sections on the website are the right place to provide your feedback.
- We created a Power BI and an Excel version of each sample file. In the book, we include pictures of Power BI reports showing the results of the code, but the examples you can download are available in both formats: Power BI and Excel.
- We improved the readability of the eBook version of DAX Patterns. This meant keeping the code formatting intact regardless of the eBook reader size.
The patterns included in this book are also available on www.daxpatterns.com
- Time-related calculations
- Standard time-related calculations
- Month-related calculations
- Week-related calculations
- Custom time-related calculations
- Comparing different time periods
- Semi-additive calculations
- Cumulative total
- Parameter table
- Static segmentation
- Dynamic segmentation
- ABC classification
- New and returning customers
- Related distinct count
- Events in progress
- Parent-child hierarchies
- Like-for-like comparison
- Transition matrix
- Basket analysis
- Currency conversion