Daily DAX : Day 468 STARTOFWEEK

DAX Function: STARTOFWEEK

STARTOFWEEK returns a table containing the first date of the week in the current filter context, according to a properly marked calendar table.

Syntax

STARTOFWEEK ( <calendar> )

<calendar> = name of your date/calendar table (must be marked as date table in Power BI)

Return Value

A single-row table with:

  • All primary tagged columns (usually Date)
  • All other time-intelligence related columns from your calendar
Important: This is a time-intelligence function.
→ Requires a proper calendar table marked as Date table
→ Works with calendar (not fiscal) week logic in recent versions

Common Use Cases

  1. Week-to-date (WTD) calculations
  2. WTD Sales = 
    CALCULATE(
        [Total Sales],
        DATESBETWEEN(
            'Calendar'[Date],
            STARTOFWEEK('Calendar'),
            LASTDATE('Calendar'[Date])
        )
    )
  3. Compare current week vs previous week
  4. Sales same week last year = 
    CALCULATE(
        [Total Sales],
        SAMEPERIODLASTYEAR(
            STARTOFWEEK('Calendar')
        )
    )
  5. Show week start date in visuals
  6. Week Commencing = 
    FORMAT(
        STARTOFWEEK('Calendar'),
        "ddd dd-mmm-yy"
    )
  7. Group fact table rows by week start (in calculated column or measure context)

Quick Reference – Related Functions

Function Purpose
STARTOFWEEKStart of current week
STARTOFMONTHStart of current month
STARTOFYEARStart of current year
ENDOFWEEKEnd of current week (if available in your version)

Last updated pattern: 2025–2026 DAX time-intelligence functions
Most common week start in business = Monday (STARTOFWEEK usually follows ISO / calendar rules)

Comments

Popular posts from this blog

Daily DAX : Day 131 SELECTEDMEASURE

Daily DAX : Day 191 MROUND

Daily DAX : Day 142 COLLAPSEALL