TRIMMEAN in DAX

TRIMMEAN in DAX

There are multiple ways of averaging values in DAX. Some of the most popular ways are mean (AVERAGE), median (MEDIAN) and mode (no built-in function; see DAX Patterns for an example). Yet another is TRIMMEAN, which exists in Excel. There is no corresponding function in DAX, and this blog post shows how you can replicate the function in DAX. Continue reading “TRIMMEAN in DAX”

New DAX functions: CONVERT and REMOVEFILTERS

DAX CONVERT and REMOVEFILTERS

August 2019 saw the introduction of two new DAX functions: CONVERT and REMOVEFILTERS. They are so new that at the time of writing this blog post (23 August 2019), they are only available in Azure Analysis Services and Power BI service, and even DAX Guide does not list them. In this blog post I’m showing what they are doing. Continue reading “New DAX functions: CONVERT and REMOVEFILTERS”

Sort by Column in Power BI

The Sort by Column feature of Power BI and tabular data models in general is well-known. The simplest example is sorting month names by their actual position in a year instead of the default (alphabetic) order. There is a popular misconception that there must be a one-to-one mapping between the column you are sorting and the column you are sorting by. This is not so, and in this blog post I am discussing unusual applications of the Sort by Column feature. Continue reading “Sort by Column in Power BI”

Exporting all data from a Power BI data model

The latest version of DAX Studio, 2.8.0, was released yesterday. It has several new features, one of which stands out for me: Export All Data. While you could write your queries to CSV files or Excel before, this feature allows you to export the whole data model at once to CSV files or — and this is why I really like it — SQL Server. In this blog post, I am showing how to do it. Continue reading “Exporting all data from a Power BI data model”

Choosing font color based on background color in Power BI

In August 2018, the Power BI team has released a new feature: conditional formatting by field value. This feature works for both background colors and font colors. Because different background colors require different font colors for text to be legible,  it makes sense to use both at the same time. In this blog post, I am showing how you can dynamically choose the font color depending on the background color. Continue reading “Choosing font color based on background color in Power BI”

DAX formula bar keyboard shortcuts in Power BI Desktop

There are several undocumented DAX formula bar keyboard shortcuts in Power BI Desktop. For instance, you can comment or uncomment portions of your code, go to a specific line of code, and do other things. Some of the keyboard shortcuts are more useful than others — this blog post lists all that I am aware of. Continue reading “DAX formula bar keyboard shortcuts in Power BI Desktop”