如何在 Excel 中使用 powerView 可视化 SQL 服务器视图?

How to visualise a SQL Server view using powerView in Excel?

我是数据可视化和 powerview 等方面的新手,但我在 SQL 服务器中有以下视图:

--This view displays any delivery that was late and by how many days
CREATE VIEW [Display Late Deliveries]
AS
--Wrapped into subquery to allow the filter of virtual column NumOfDaysLate
SELECT * from (

SELECT dbo.tblPurchaseOrder.PurchaseOrderID, dbo.tblPurchaseOrder.SupplierID, 
    DATEADD(D, dbo.tblPurchaseOrder.LeadTimeDays, dbo.tblPurchaseOrder.DateOfOrder) 
AS ExpectedDelivery, dbo.tblPurchaseInvoice.GoodsReceived,
    DATEDIFF(D, ExpectedDelivery, GoodsReceived) 
AS NumOfDaysLate

FROM   dbo.tblPurchaseOrder LEFT OUTER JOIN
         dbo.tblPurchaseInvoice ON dbo.tblPurchaseOrder.PurchaseOrderID = dbo.tblPurchaseInvoice.PurchaseOrderID
) x
WHERE x.NumOfDaysLate > 0

在 powerview 中,我似乎只能使用 select 表,没有其他方法可以使用 DAX 显示此视图,如果可以,我将如何处理它,或者是否有另一种可视化方法这个?

好的,所以我发现了问题,我在创建视图之前导入了数据源,但是在 excel 中刷新数据时,它只更新了我选择导入的表。我再次导入,它提供了在您选择要使用的表时包含视图的选项。