具有DAX和多个事实表的SSRS数据集

时间:2018-11-29 16:36:43

标签: reporting-services ssas dax tabular

我想创建连接到SSAS表格数据库的SSRS报告。该SSRS报告应包含一个矩阵,其中包含按年份和成本类型分组的成本和预算成本。

Matrix

现在我的问题是,成本表和预算成本表都是事实表。我不了解足够的DAX来从两个事实表中获取列。现在,我只能创建包含成本或预算成本的数据集。 我考虑了两个矩阵中的两个数据集。但这显然不是一个好的解决方案。

Data model

这是我(无效)DAX代码的样本。

EVALUATE
 (
    FILTER (
        SUMMARIZE (
            Costs,
            Costs[IScost],
            Time[year],
            CostType[name],
            PlanedCosts[ISplanedcost]
        ),
        Time[year] = 2018
    )
)

我认为这不是一项艰巨的任务,但是到目前为止,我还没有找到DAX和SSRS的解决方案。我无法相信DAX无法做到这一点。还是我真的需要使用例如MDX查询? 如果有人可以引导我朝正确的方向前进,我将不胜感激。

1 个答案:

答案 0 :(得分:0)

因此,这是一个基于Adventure Works的示例。它具有MDX查询,可精确查询您想要达到的目标。只需更换尺寸和尺寸,您就会很好

Select 
non empty //Non empty eliminates the null combinations
(
[Date].[Calendar Year].[Calendar Year], // Place your Date dimension here 
{[Measures].[Internet Sales Amount],[Measures].[Internet Order Quantity]} //These will be the two measures cost & budget. 
)
on columns,
non empty //Non empty eliminates the null combinations
[Product].[Subcategory].[Subcategory] //Place your cost type dimension here 
on rows 
from [Adventure Works]

enter image description here

相关问题