Analyzing and Visualizing Data with Microsoft Power BI — Question 91

You have a Power BI model for sales data. You create a measure to calculate the year-to-date sales.
You need to compare the year-to-date sales with the previous year for the same time period.
Which DAX function should you use?

Answer options

Correct answer: C

Explanation

The correct answer is C, SAMEPERIODLASTYEAR, as it specifically allows you to compare the year-to-date sales with the same period in the previous year. The other options either calculate totals, return last dates, or manipulate dates without providing the direct comparison required for this scenario.