You work for MDFT Pro, where you’re analyzing course purchase data using a Power BI semantic model backed by a Fabric warehouse named DW1. The warehouse contains the following tables and columns that store course purchases:
Table name | Column name |
---|---|
Purchase | CourseID |
Purchase | ModifiedDate |
Purchase | OrderQty |
Course | CourseID |
Course | Name |
You’ve written the following T-SQL query to summarize OrderQty
by year and course, including yearly totals and a grand total:
SELECT
YEAR(p.ModifiedDate) AS OrderDate,
c.Name AS CourseName,
SUM(p.OrderQty) AS OrderQty
FROM [Purchase] p
INNER JOIN [Course] c
ON c.CourseID = p.CourseID
GROUP BY ROLLUP(YEAR(p.ModifiedDate), c.Name)
ORDER BY OrderDate
You want to exclude only the grand total row, while still returning:
Which WHERE clause should you add to achieve this?
Choose the correct answer from the options below.
Explanations for each answer: