Topic: DAX
-
DAX has many time intelligence functions that are often redundant, offering different shorter syntaxes for longer more generic functions. However, sometimes the shorter syntax could be dangerous, as I explain in this blog post where I suggest using CALCULATE and… Read more
-
UPDATE 2019-10-18 Because of a bug in YEARFRAC function described in the original blog post and reported by Dominik Petri (thanks!), there are cases where the previous solution does not work well. Moreoever, YEARFRAC is not that fast, so a… Read more
-
I received a question about how to implement the equivalent of a DISTINCTCOUNTX function in DAX. Well, such a function doesn’t exist in DAX, but imagine you want to write something like: The corresponding measure working in DAX is: In… Read more
-
If you have a fiscal year starting in March, you can have a problem using the time intelligence functions in DAX. For example, by using February 28, the fiscal year starts on February 29th in leap years. By using February… Read more
-
In the latest weeks I received several requests to support a different color for variable names in DAX Formatter, just as the formula editor available in Power BI. I finally implemented a solution that I consider a workaround, because of… Read more
-
A recurring issue for Power BI users writing DAX code is that column filter removal might have an unexpected behavior when the Sort by Column is active on the column. I covered this topic in an article related to RANKX,… Read more
-
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 this parameter is used only… Read more
-
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… Read more
-
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… Read more
-
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 blank value, there is a bug… Read more