Setting Data Types When Building Table Values In Power BI

Chris Webb shows how to use a parameter on the Table.AddColumn function in M to define specific data types:

In the last two screenshots the ABC123 icon in the column headers show that they are set to use the Any data type; the columns returned by calling the function have lost their data types.

The key to solving this problem is using the optional fourth parameter of the Table.AddColumn() function, which allows you to set a data type for the column that function adds to a table. Altering the Invoked Custom Function step of the previous query to do this, setting the new column to be a table type like so:

Worth reading in its entirety.

Related Posts

The Importance of Interaction in Power BI

Marc Lelijveld continues a series on storytelling with Power BI: Many times, I see reports with loads of visuals on the pages. This results in both a really poor performance, as well as the end user has no clue what the key message is of this report. You can always ask yourself, is this visual […]

Read More

Running Power BI Desktop as a Different Account

Gilbert Quevauvilliers shows how you can run Power BI Desktop as a different domain account, even when your logged-in account is not on the domain: This is not the greatest error message. Fortunately, I knew that I could connect to the server so the issue was not with connectivity but more around how could I […]

Read More

Categories

September 2017
MTWTFSS
« Aug Oct »
 123
45678910
11121314151617
18192021222324
252627282930