Syntax
FORMAT(<value>, <format_string>)
Tutorial with example
In today’s video we will go through FORMAT function in DAX. We will learn how to use pre-formated functions and custom functions to format numbers and dates using DAX.
Keynotes:
01:00 Microsoft documentation on FORMAT DAX function
02:23 Pre-defined number formatting: “General Number”
03:30 Pre-defined number formatting: “Currency”
04:38 Pre-defined number formatting: “Fixed”
05:10 Pre-defined number formatting: “Standard”
06:00 Pre-defined number formatting: “Percent”
06:23 Pre-defined number formatting: “Scientific”
07:31 Format numbers without decimals
08:05 Format numbers with four decimals
08:45 Format numbers to millions and thousands
10:18 Format numbers with Leading zeros
10:51 Format numbers with one decimal
11:09 Format numbers with percent symbol
11:25 Format numbers with Scientific symbol
11:53 Pre-defined date formatting: “General Date”
12:10 Pre-defined date formatting: “Long Date”
12:40 Pre-defined date formatting: “Short Date”
12:49 Pre-defined date formatting: “Long Time”
12:50 Pre-defined date formatting: “Medium Time”
12:55 Pre-defined date formatting: “Short Time”
13:17 Format dates to return the Day number
13:22 Format dates to return Month number
13:30 Format dates to get dd-mm-yyyy format
Download example file:
To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #32
Remarks
All predefined formatting strings use the current user locale when formatting the result.
This DAX function is not supported for use in DirectQuery mode.
Leave a Reply