
Answer-first summary for fast verification
Answer: EVALUATE SUMMARIZECOLUMNS('Orders'[CustomerID], "TotalAmount", CALCULATE(SUM('Orders'[TotalAmount]), 'Orders'[OrderDate] >= DATEADD(YEAR, -1, TODAY())))
Option B correctly sums the order amounts for each customer and filters the orders to include only those from the last year. Options A, C, and D either do not filter the date correctly or do not sum the amounts correctly.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Given a scenario where you need to connect to and query datasets using the XMLA endpoint in Fabric, you have a tabular model with a table named 'Orders' that contains columns 'OrderID', 'CustomerID', 'OrderDate', and 'TotalAmount'. Write a DAX query to find the total amount of orders for each customer in the last year. How would you structure this query?
A
EVALUATE SUMMARIZECOLUMNS('Orders'[CustomerID], "TotalAmount", SUM('Orders'[TotalAmount]))
B
EVALUATE SUMMARIZECOLUMNS('Orders'[CustomerID], "TotalAmount", CALCULATE(SUM('Orders'[TotalAmount]), 'Orders'[OrderDate] >= DATEADD(YEAR, -1, TODAY())))
C
EVALUATE SUMMARIZECOLUMNS('Orders'[CustomerID], "TotalAmount", CALCULATE(SUM('Orders'[TotalAmount]), 'Orders'[OrderDate] >= DATEADD(YEAR, -1, NOW())))
D
EVALUATE SUMMARIZECOLUMNS('Orders'[CustomerID], "TotalAmount", SUM('Orders'[TotalAmount]))