Strange behavior of HASONEVALUE and SELECTEDVALUE
I recently stumbled across a strange behavior of HASONEVALUE, which also impacts the SELECTEDVALUE function. When the only selected item in a column is a numeric value 0 and the column also contains a...
View ArticleDAX Best Practices
As with any other language, you can write good DAX but you can also write bad DAX. Good DAX works fine, it is fast and reliable and can be updated easily. Bad DAX, on the other hand is… well, just bad....
View ArticleUsing TREATAS in place of IN in DAX
During a conversation at PASS Summit, one of the developers of Power BI shown me a way to use TREATAS in place of IN in DAX. I am not sure it increases readability of the code, but let’s examine pros...
View ArticleHow to handle BLANK in DAX measures
This article describes a counterintuitive behavior of BLANK in DAX measures affecting Power BI, Analysis Services, and Power Pivot. That behavior could cause mistakes in a report using alternate...
View ArticleComputing same product sales in DAX
This article shows a technique in DAX to compute the sales volume of products that were available right from the beginning of a selected time period, ignoring products introduced afterwards. Consider a...
View ArticleWhat has happened in the DAX world in 2017
We are approaching the end of 2017, so it is a good time to review what happened in the DAX world this year, what we’ve been up to at SQLBI and what is going to happen in 2018. New DAX functions in...
View ArticleContext Transition and Filters in CALCULATE
This article explains how the context transition interacts with the filter arguments of a CALCULATE function in DAX. This is important in order to avoid unexpected results with complex calculations...
View ArticleOptimizing duplicated DAX expressions using variables
This article describes how to use variables to optimize the performance of DAX expressions containing multiple instances of the same measure or the same sub-expression. In DAX, variables should be used...
View ArticleWhy I attend conferences and why I speak at conferences
I’ve recently been asked to talk about my experience as a speaker at technical conferences. I wasn’t sure what to say, until I realized that it makes more sense to start with explaining the reasons...
View ArticlePower Pivot Utilities 1.09
Bertrand d’Arbonneau added a new feature in the last version (v 1.09) of Power Pivot Utilities, which allows the visualization of Dependents and Precedents measures in the measure list created by the...
View ArticleThe definitive guide to ALLSELECTED
ALLSELECTED is a powerful function that can hide several traps. This article is an in-depth analysis of the behavior of ALLSELECTED, explaining shadow filter contexts, what they are and how they are...
View ArticleDAX optimization examples
How do you optimize a DAX expression? In this session we analyze some DAX expressions and Tabular models and we will look at how to optimize them through the usage of DAX Studio and some understanding...
View ArticleThe new Data Modeling for Power BI course
If you import more than one table into Power BI or Power Pivot, you have a data model. When you have more than one table, you usually have relationships between tables. When you analyze data, you often...
View ArticleDAX Date Template
DAX Date Template is a Power BI template file containing a fully-featured Date table. This template spares the user from writing the required DAX expression – as well as in setting the necessary...
View ArticleReference Date Table in DAX and Power BI
This article describes a reference Date table in DAX using a Power BI template. The same technique can be used in Analysis Services models. Download the latest version of the template in the Dax Date...
View ArticleTwo weeks, two countries, two conferences, one family
In the last week, I have been speaking at two different events in a few days: SQLBits 2018 in London, UK and SQL Konferenz 2018 in Darmstadt, Germany. These two events created for SQL Server...
View ArticleManaging “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT
This article provides a complete explanation of the behavior of the ALLxxx functions in DAX. When used as filters in CALCULATE, ALLxxx functions might display unexpected behaviors. Because the topic of...
View ArticleCapturing Power BI queries using DAX Studio
This article describes how to use DAX Studio to capture DAX queries generated by Power BI. Analyzing DAX queries can be helpful to better understand performance issues, and to improve the writing of...
View ArticleInternational year_end_date for YTD functions in DAX
If you used the DATESYTD and TOTALYTD functions in DAX, you might have noticed that the optional parameter year_end_date is a string defining the last day of the year. The default is December 31, so...
View ArticleExpanded tables in DAX
Expanded tables are the core of DAX; understanding how they work is of paramount importance. This article provides a theoretical foundation of what expanded tables are, along with fundamental concepts...
View Article