DAX Function Guide

FORMAT
Empty image or helper icon

Sam McKay

CEO & Founder

How does the FORMAT 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?

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

Loading

Considerations when using the FORMAT?

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

Loading

Formula examples using the FORMAT

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

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

Format(“0.981”, “Percent”)

Related Courses

Loading