power-query
-
Custom M Function #4: fxSetColumnTypesFromModel

Introduction Click here to go straight to the function. *Disclaimer* this function is not the most exciting but is used in a few other more exciting functions I plan on sharing. Sometimes when performing transformations in Power Query, data types are lost, e.g., when unioning two tables and columns with the same name have different Continue reading
-
Custom M Function #3: fxSplitCamelCaseText

Introduction Click here to go straight to the function. When importing data from a database, column names are often stored in camel or pascal case because of the challenges/inconveniences spaces can cause. While it is best practice to avoid spaces in SQL column names, I prefer storing Power BI column names in proper case because Continue reading
-
Underrated Power BI Feature: Measures as Visual Filters

Introduction One of the features I love in Power BI that I don’t think gets enough love is the ability to use measures as filters on a visual. Unlike page or report filters, which have to be applied on columns in a table, visual filters can be applied to either columns or measures. For example, Continue reading
-
Custom M Function #2: fxGenerateSurrogateKeyColumn

Introduction Click here to go straight to the function. One of the key (pun intended) aspects of dimensional modeling is the creation of surrogate keys in your dimension tables. A surrogate key is a column generated to serve as the primary key of the dimension in lieu of the natural key. There are many reasons Continue reading
-
Custom M Function #1: fxJoinAndExpandTable

Introduction Click here to go straight to the function. If you are doing any type of dimensional modeling in Power BI using Power Query, you are probably very familiar with the “Merge Queries” button that helps the user join two tables together. Although the GUI is very useful, the resulting code may not be as Continue reading
-
Intro to Custom M Functions

I have been spending a lot of time in Power Query lately, and one thing that I have been trying to do is to compile a custom M function library that I can use to speed up my development instead of writing the same transformations over and over again (see What is DRY? Hint: It Continue reading
