我对 Adventure Works DB 有以下 DAX 查询:
evaluate
(
summarize
(
'Internet Sales',
'Product Category'[Product Category Name],
'Product Subcategory'[Product Subcategory Name],
'Product'[Product Name],
'Date'[Calendar Year],
"Total Sales Amount", sum('Internet Sales'[Sales Amount])
)
)
order by 'Product Category'[Product Category Name],
'Product Subcategory'[Product Subcategory Name],
'Product'[Product Name]
这将返回以下格式的数据:
Accessories Bike Racks Hitch Rack - 4-Bike 2008 22920
Accessories Bike Racks Hitch Rack - 4-Bike 2007 16440
Accessories Bike Stands All-Purpose Bike Stand 2008 20670
我想这样返回它:
CATEGORY SUB CATEGORY PRODUCT 2007 2008 2009 2010
Accessories Bike Racks Hitch Rack - 4-Bike 22920 16440 22920 16440
Accessories Bike Stands All-Purpose Bike Stand 20850 20670 22920 16440
结果集中每年都应该有一列。
这可能吗?如果是这样怎么办?
谢谢