Forum Discussion

HarsimPWRBI's avatar
HarsimPWRBI
Frequent Visitor
8 years ago

Why does Values shows blank row even if there are none?

Hey Tech buddies,

 

I'm reading the-definitive-guide-to-dax and in Chapter 3 FIGURE 3-15  has a pivot table.

Which shows 1 for column "Values Products" with "Sales Amount" of $16.90.

 

The Reason It states , is there are sales for product for which there's no data in Product table.

 

But If i go to database and execute below query there's no rows like same.

USE ContosoRetailDW
GO

SELECT * FROM [DaxBook].[Sales] a
WHERE NOT EXISTS (SELECT 1 FROM [DaxBook].[Product] b WHERE a.ProductKey=b.ProductKey)

 

Moreover i tried to rollup in database but there i got only three rows for class with their aggregrate Sales Amount

 


SELECT b.Class, SUM(a.Quantity*a.[Unit Price]) AS SalesAmount FROM [DaxBook].[Sales] a
right JOIN DaxBook.Product b
ON a.ProductKey=b.ProductKey
GROUP BY b.Class

 

Please suggest.

 

Database and PowerBI Model for same

 

Thanks,

Harry

2 Replies