SQL equivalent

To help understand filter context and to validate certain reports or DAX measures, it can be helpful to compare Power BI reports to SQL statements. The following SQL statement returns the same six values of the Power BI matrix (excluding the subtotals) via standard inner joins and WHERE clause conditions:

SELECT  P.[Product Category], C.[Customer Marital Status], FORMAT(SUM(F.[Unit Price] * F.[Order Quantity]), '$#,###') AS [Internet Gross Sales]FROM BI.vFact_InternetSales as F  INNER JOIN BI.vDim_FinDate as D on F.[Order Date Key] = D.[Date Key]  INNER JOIN BI.vDim_Promotion as Promo on F.[Promotion Key] = Promo.[Promotion Key]  INNER JOIN BI.vDim_Product as P on F.[Product Key] = P.[Product Key] INNER JOIN BI.vDim_Customer as ...

Get Mastering Microsoft Power BI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.