
Answer-first summary for fast verification
Answer: CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Order'[Order Date]))
The CALCULATE function is used in DAX to change the context in which the data is evaluated. In this case, CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Order'[Order Date])) is the correct choice because it calculates the total sales by modifying the context to the same period last year using the SAMEPERIODLASTYEAR function. Using SUMMARIZE would not be appropriate here, as it is used to create a summary table for grouping and aggregation, not for calculating measures in different time contexts.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
As a Fabric tenant administrator, you manage a semantic model that holds data relating to various retail stores. Your task is to write a DAX query that will be executed using the XMLA endpoint. The specific requirement is for the query to return the total amount of sales from the corresponding period in the previous year. What steps and DAX functions should you use to complete the query? To address this, choose the correct options in the answer area. NOTE: Each correct selection is worth one point.
A
CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Order'[Order Date]))
B
SUMMARIZE([Total Sales], SAMEPERIODLASTYEAR('Order'[Order Date]))
C
CALCULATE, _LYSales
D
SUMMARIZE, _LYSales
No comments yet.