The correct syntax uses CALCULATE with SUM and DATESYTD as a filter.
What does a cumulative total show in a report?
ASum of values up to each date in the period
BOnly the value for the last date
CAverage of all values
DDifference between dates
✗ Incorrect
Cumulative totals add values progressively up to each date, showing running totals.
Explain how you would create a year-to-date sales measure using DATESYTD in Power BI.
Think about how to sum sales from the start of the year to the current date.
You got /4 concepts.
Describe the difference between cumulative totals and year-to-date totals and when you might use each.
Consider how the time frame affects the totals shown.
You got /4 concepts.
Practice
(1/5)
1. What does the DAX function DATESYTD do in Power BI?
easy
A. Returns the last date of the year
B. Calculates the total sales for the entire year
C. Filters dates only for the current month
D. Returns all dates from the start of the year up to the current date
Solution
Step 1: Understand the purpose of DATESYTD
DATESYTD returns a table of dates starting from January 1st of the current year up to the specified date, usually today.
Step 2: Compare options with definition
Only Returns all dates from the start of the year up to the current date correctly describes this behavior, while others describe different date filters or totals.
Final Answer:
Returns all dates from the start of the year up to the current date -> Option D
Quick Check:
DATESYTD = Year start to today [OK]
Hint: DATESYTD always starts from Jan 1 to current date [OK]
Common Mistakes:
Confusing DATESYTD with monthly filters
Thinking it returns totals instead of dates
Assuming it returns dates for the whole year
2. Which of the following is the correct syntax to calculate year-to-date sales using DATESYTD in DAX?
easy
A. YTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD(Calendar[Date]))
B. YTD Sales = SUM(Sales[Amount]) + DATESYTD(Calendar[Date])
C. YTD Sales = FILTER(Sales, DATESYTD(Calendar[Date]))
D. YTD Sales = CALCULATE(DATESYTD(Sales[Amount]), Calendar[Date])
Solution
Step 1: Identify correct use of CALCULATE and DATESYTD
CALCULATE modifies filter context; DATESYTD returns dates. The correct syntax uses CALCULATE with SUM and DATESYTD as filter.
But it returns an error. What is the likely cause?
medium
A. Sales[Amount] should be replaced with Sales[Date]
B. DATESYTD requires a date column from a calendar table, not from the Sales table
C. DATESYTD needs two arguments, but only one is provided
D. SUM cannot be used inside CALCULATE
Solution
Step 1: Check argument for DATESYTD
DATESYTD expects a continuous date column, usually from a calendar table, not transactional tables like Sales.
Step 2: Identify error cause
Using Sales[Date] (likely non-continuous) causes error; correct is to use Calendar[Date] from a proper date table.
Final Answer:
DATESYTD requires a date column from a calendar table, not from the Sales table -> Option B
Quick Check:
DATESYTD needs calendar date column [OK]
Hint: Use calendar table date column with DATESYTD [OK]
Common Mistakes:
Using transactional table date column
Assuming SUM can't be inside CALCULATE
Thinking DATESYTD needs two arguments
5. You want to create a cumulative total measure that resets at the start of each year. Which DAX expression correctly achieves this?
hard
A. Cumulative Total = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Calendar[Date]), YEAR(Calendar[Date]) = YEAR(MAX(Calendar[Date])) && Calendar[Date] <= MAX(Calendar[Date])))
B. Cumulative Total = CALCULATE(SUM(Sales[Amount]), DATESYTD(Sales[Date]))
C. Cumulative Total = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Calendar[Date]), Calendar[Date] <= MAX(Calendar[Date])))
D. Cumulative Total = SUMX(FILTER(Calendar, Calendar[Date] <= MAX(Calendar[Date])), Sales[Amount])
Solution
Step 1: Understand requirement to reset cumulative each year
The cumulative total must sum sales from the start of the current year to the current date, resetting yearly.
Step 2: Analyze each option
Cumulative Total = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Calendar[Date]), Calendar[Date] <= MAX(Calendar[Date]))) sums from earliest date ever, no reset. Cumulative Total = CALCULATE(SUM(Sales[Amount]), DATESYTD(Sales[Date])) uses DATESYTD(Sales[Date]), which requires a date column from a calendar table. Cumulative Total = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Calendar[Date]), YEAR(Calendar[Date]) = YEAR(MAX(Calendar[Date])) && Calendar[Date] <= MAX(Calendar[Date]))) filters dates to current year and up to current date, correctly resetting yearly. Cumulative Total = SUMX(FILTER(Calendar, Calendar[Date] <= MAX(Calendar[Date])), Sales[Amount]) sums incorrectly without filter context.
Final Answer:
Cumulative Total = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Calendar[Date]), YEAR(Calendar[Date]) = YEAR(MAX(Calendar[Date])) && Calendar[Date] <= MAX(Calendar[Date]))) -> Option A
Quick Check:
Filter by year and date <= MAX for yearly reset [OK]
Hint: Filter dates by year and <= MAX date for yearly cumulative [OK]
Common Mistakes:
Not filtering by year causes cumulative to never reset
Using DATESYTD with Sales[Date] instead of Calendar[Date]
Ignoring ALL removes filters incorrectly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.