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
→ Requires a proper calendar table marked as Date table
→ Works with calendar (not fiscal) week logic in recent versions
Common Use Cases
- Week-to-date (WTD) calculations
- Compare current week vs previous week
- Show week start date in visuals
- Group fact table rows by week start (in calculated column or measure context)
WTD Sales =
CALCULATE(
[Total Sales],
DATESBETWEEN(
'Calendar'[Date],
STARTOFWEEK('Calendar'),
LASTDATE('Calendar'[Date])
)
)
Sales same week last year =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR(
STARTOFWEEK('Calendar')
)
)
Week Commencing =
FORMAT(
STARTOFWEEK('Calendar'),
"ddd dd-mmm-yy"
)
Quick Reference – Related Functions
| Function | Purpose |
|---|---|
| STARTOFWEEK | Start of current week |
| STARTOFMONTH | Start of current month |
| STARTOFYEAR | Start of current year |
| ENDOFWEEK | End 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
Post a Comment