Daily DAX : Day 461 TOTALWTD
TOTALWTD – Week-to-Date Total
TOTALWTD is a DAX time-intelligence function in Power BI that calculates the cumulative total (running total) from the start of the week up to the current date in context.
Syntax
TOTALWTD(
<expression>,
<dates>
[,<filter>]
)
Parameters
- <expression> → usually an aggregation like
SUM(Sales[Amount]) - <dates> → reference to your date column (e.g.
'Calendar'[Date]) - [<filter>] → optional additional filter (rarely used)
Important Requirements
- The table containing
<dates>must be marked as a Date table in Power BI - Week starts on Sunday by default (standard ISO-like week behavior in most cases)
- Does not work reliably in DirectQuery mode for calculated columns / RLS
Common Use Cases
1. Week-to-date Sales
WTD Sales =
TOTALWTD(
SUM(Sales[Amount]),
'Calendar'[Date]
)
→ Shows sales from Monday (or Sunday) until the selected day.
2. Compare WTD this year vs last year
WTD Sales LY =
CALCULATE(
[WTD Sales],
SAMEPERIODLASTYEAR('Calendar'[Date])
)
3. Week-to-date Orders in a card / KPI visual
Very popular in retail, call-centers, logistics, daily operations dashboards.
Quick Comparison – Similar functions
| Function | Period | Starts from |
|---|---|---|
| TOTALWTD | Week | Start of week |
| TOTALMTD | Month | 1st of month |
| TOTALQTD | Quarter | Start of quarter |
| TOTALYTD | Year | 1st of year (or custom fiscal start) |
Tip
If your week starts on Monday (very common in Europe/UK), make sure your calendar table correctly reflects it — TOTALWTD respects the first day present in the current week context.
Comments
Post a Comment