Basic.Dates

Simple function to centralize date formats in a model. Returns a standardized date format string that can be consistently applied across all date columns in your data model.

Syntax

DaxLib.FormatString.Basic.Dates ( )

Definition

DAX
// Simple function to centralize date formats in a model.
// Main benefit is that if you want to change it, you only have to do it in one place.
//
// Recommended: Use a Tabular Editor Macro to assign this function to the format string of every Date field.
() =>
    // Replace with one of the other, commented options, below.

    -- e.g. 2025-12-25 (ISO 8601 - International Standard)
    "yyyy-MM-dd"

    -- e.g. 12/25/2025 (Confusing Format)
    -- "MM/dd/yyyy"

    -- e.g. 25/12/2025 (European/UK Format)
    -- "dd/MM/yyyy"

    -- e.g. Dec 25, 2025 (Abbreviated Month)
    -- "MMM dd, yyyy"

    -- e.g. Dec 25, 2025 (Abbreviated Month and Year)
    -- "MMM dd, 'yy"

    -- e.g. December 25, 2025 (Full Month Name)
    -- "MMMM dd, yyyy"

    -- e.g. 25-Dec-2025 (Day-Month-Year with Dashes)
    -- "dd-MMM-yyyy"

    -- e.g. 25 Dec 2025 (Day Month Year with Spaces)
    -- "dd MMM yyyy"

    -- e.g. Thursday, December 25, 2025 (Full Day and Month Names)
    -- "dddd, MMMM DD, yyyy"

    -- e.g. Thu, Dec 25, 2025 (Abbreviated Day Name)
    -- "ddd, MMM DD, yyyy"

    -- e.g. 25.12.2025 (European Format with Dots)
    -- "dd.MM.yyyy"

Parameters

This function takes no parameters.

Example

DaxLib.FormatString.Basic.Dates ()

Use this function in a measure's formatStringDefinition to apply standardized date formatting.

Related Functions