Daily DAX : Day 417 STARTOFQUARTER
Power BI DAX: STARTOFQUARTER Function
Syntax
STARTOFQUARTER(<date>)
Description
Returns the first date of the quarter that contains the given date. The result is always a date at midnight (00:00:00) of the first day of that quarter.
Parameters
- <date> – Any expression that returns a date/datetime value (usually a column from a date table)
Return Value
A date representing the first day of the quarter (e.g., 1 January, 1 April, 1 July, or 1 October).
Examples
| Input Date | STARTOFQUARTER Result | Quarter |
|---|---|---|
| 2025-03-15 | 2025-01-01 | Q1 2025 |
| 2025-05-20 | 2025-04-01 | Q2 2025 |
| 2025-08-10 | 2025-07-01 | Q3 2025 |
| 2025-12-31 | 2025-10-01 | Q4 2025 |
Common Use Cases
- Quarter-to-Date (QTD) Calculations
QTD Sales = CALCULATE( SUM(Sales[Amount]), DATESQTD('Date'[Date]) // Internally uses STARTOFQUARTER ) - Comparing Current Quarter vs Previous Quarter
Previous Quarter Sales = CALCULATE( SUM(Sales[Amount]), DATEADD(STARTOFQUARTER('Date'[Date]), -1, QUARTER) ) - Creating a Quarter Start Column in a Date Table
Quarter Start = STARTOFQUARTER('Date'[Date]) - Building Dynamic Titles or Filters
Current Quarter Start = STARTOFQUARTER(TODAY())
Tips
- Use with a proper Date table marked as date table in Power BI for best performance.
- Combine with
ENDOFQUARTERto get the full range of a quarter. - Works with any fiscal calendar if your date table already defines quarters correctly.
Related Functions: STARTOFMONTH, STARTOFYEAR, ENDOFQUARTER, DATEADD, DATESQTD
Comments
Post a Comment