0
0
Power BIbi_tool~20 mins

DATESYTD and cumulative totals in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DATESYTD Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate Year-To-Date Sales Using DATESYTD

You have a Sales table with daily sales data and a Date table linked by the Date column. You want to create a measure that calculates the total sales from the start of the year up to the current date in the filter context.

Which DAX measure correctly calculates the Year-To-Date sales?

AYTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD('Date'[Date]))
BYTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD(Sales[Date]))
CYTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD('Sales'[Date]))
DYTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD('Date'[Year]))
Attempts:
2 left
💡 Hint

Remember that DATESYTD requires a date column from a proper Date table.

visualization
intermediate
2:00remaining
Best Visualization for Cumulative Sales Over Time

You have created a measure that calculates cumulative sales over the year using DATESYTD. You want to show this cumulative total over months in a report.

Which visualization type is best to clearly show the cumulative sales trend over time?

APie Chart showing cumulative sales by month
BTable showing cumulative sales by month
CLine Chart showing cumulative sales by month
DStacked Bar Chart showing cumulative sales by month
Attempts:
2 left
💡 Hint

Think about which chart type best shows trends over time.

data_modeling
advanced
2:00remaining
Handling Missing Dates in Cumulative Total Calculation

Your sales data has missing dates (no sales recorded on some days). You want to calculate a cumulative total sales measure that correctly accumulates sales over all calendar days, including those with no sales.

Which data modeling approach helps ensure the cumulative total measure works correctly?

ACreate a measure that ignores the Date table and sums sales directly
BUse only the Sales table dates for cumulative calculation
CFilter out dates with no sales from the Date table
DCreate a continuous Date table with all dates and relate it to Sales by Date
Attempts:
2 left
💡 Hint

Think about how time intelligence functions handle missing dates.

🔧 Formula Fix
advanced
2:00remaining
Identify the Error in This Cumulative Total Measure

Review the following DAX measure intended to calculate cumulative sales year-to-date:

YTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD('Date'[Date], "06/30"))

What is the issue with this measure?

Power BI
YTD Sales = CALCULATE(SUM(Sales[Amount]), DATESYTD('Date'[Date], "06/30"))
AThe date format "06/30" is invalid; it should be a date value, not a string
BThe DATESYTD function does not accept a second argument
CThe measure is missing a FILTER function to limit dates
DThe SUM function cannot be used inside CALCULATE
Attempts:
2 left
💡 Hint

Check the DATESYTD function syntax for the year-end date argument.

🧠 Conceptual
expert
2:00remaining
Understanding the Impact of Filter Context on Cumulative Totals

You have a cumulative sales measure using DATESYTD. When you add a slicer filtering by Product Category, the cumulative totals change unexpectedly and do not accumulate correctly over time.

What is the most likely reason for this behavior?

AThe measure needs to use ALL('Date') to ignore the slicer filter
BThe filter context from the Product Category slicer affects the Date table, breaking the cumulative calculation
CDATESYTD ignores all filters except on the Date column
DThe relationship between Sales and Date tables is inactive
Attempts:
2 left
💡 Hint

Think about how slicers affect filter context and time intelligence functions.