Basic.Quarters
Simple function to centralize quarter formats in a model. Returns a standardized quarter format string for consistent quarterly reporting and analysis across your data model.
Syntax
DaxLib.FormatString.Basic.Quarters ( )
Definition
DAX
// Simple function to centralize quarter 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 Quarter field.
( ) =>
VAR _Q = "Q"
VAR _Qtr = "Qtr"
VAR _FY = "FY"
VAR _Quarter = QUARTER ( SELECTEDMEASURE () )
VAR _Format =
// Replace with one of the other, commented options, below.
-- e.g. 2025 Q4 (Year Quarter - Most Common)
"yyyy " & _Q & _Quarter
-- e.g. Q4 2025 (Quarter Year)
-- _Q & _Quarter & "yyyy"
-- e.g. 2025-Q4 (Year-Quarter with Dash)
-- "yyyy-" & _Q & _Quarter
-- e.g. Q4/2025 (Quarter/Year with Slash)
-- _Q & _Quarter & "/yyyy"
-- e.g. 2025 Qtr 4 (Year with "Qtr" Abbreviation)
-- "yyyy " & _Qtr & _Quarter
-- e.g. FY2025 Q4 (Fiscal Year Quarter)
-- _FY & "yyyy " & _Q & _Quarter
-- e.g. 25 Q4 (Short Year Quarter)
-- "YY " & _Q & _Quarter
-- e.g. 2025Q4 (Compact Format)
-- "yyyy" & _Q & _Quarter
-- e.g. Q4-25 (Quarter-Short Year)
-- _Q & _Quarter & "-yy"
-- e.g. 4Q 2025 (Number Q Year)
-- _Quarter & _Q & " yyyy"
RETURN
_Format
Parameters
This function takes no parameters.
Example
DaxLib.FormatString.Basic.Quarters ()
Use this function in a measure's formatStringDefinition to apply standardized quarter formatting.
Related Functions
- Basic.Dates - Date-level formatting
- Basic.Months - Month-level formatting
- Basic.Numbers - Numeric formatting for quarterly figures