FORMAT Function (DAX)

How does the FORMAT function (DAX) work?

The FORMAT function (DAX) converts a value to text according to the specified format.

FORMAT Formula Syntax

FORMAT (
     <value> , <format_string>
)

How do you use the FORMAT function?

You can used FORMAT function wherever you can use expressions. For example, you can use it in a query as part of a field alias, or in the Control Source property of a text box on a form or a report.

Related Blog Posts

Related Support Forum Posts

How to format a Button on selection
Formatting columns of Data but only for YTD figures
Conditional Formatting for not-equal to a summary value

Considerations when using the FORMAT function

Important Note:

If value is BLANK() the function returns an empty string.

If format_string is BLANK(), the value is formatted with a “General Number” or “General Date” format (according to value type).

Caution: The format strings supported as an argument to the DAX FORMAT function are based on the format strings used by Visual Basic (OLE Automation), not on the format strings used by the .NET Framework. Therefore, you might get unexpected results or an error if the argument does not match any defined format strings. For example, “p” as an abbreviation for “Percent” is not supported. Strings that you provide as an argument to the FORMAT function that are not included in the list of predefined format strings are handled as part of a custom format string, or as a string literal.

Related Video Tutorials

Formula examples using the FORMAT function

=Format(Now(),”ww”)-1

Format(“210.6”, “#,##0.00”)

Format(“0.981”, “Percent”)

Related DAX Functions

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formula Reference Guide