CODE Function (DAX)

How does the CODE function (DAX) work?

The CODE function (DAX) returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer.

CODE(
     text
)

How do you use the CODE function?

The CODE function is a built-in function in Excel that is categorized as a String/Text. It can be used as a worksheet function in Excel. As a worksheet function, the CODE function can be entered as part of a formula in a cell of a worksheet.

Related Blog Posts

Related Support Forum Posts

Understanding DAX Formula
Developing Complex Dax functions

Considerations when using the CODE function

The specified character to retrieve the ASCII value for. If there is more than one character, the function will return the ASCII value for the first character and ignore all of the characters after the first.

Related Video Tutorials

Formula examples using the CODE function

=CODE(“A”)

=CODE(“!”)

=CODE(A2)

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.