简体   繁体   English

报表生成器 使用 power bi 数据集聚合 function

[英]Report builder Aggregate function with power bi dataset

I'm trying to recreate a power bi report (Power BI Desktop) in Power Bi Report Builder where I'm using a non-additive measure.我正在尝试在 Power Bi 报表生成器中重新创建一个 Power Bi 报表(Power BI Desktop),我正在使用非加法度量。 I have read that I can use Report Builder's Aggregate function to move the aggregation to the server side and this way use my DAX measure from the model but I fail to get the same result as I get in Power BI.我已经读到我可以使用 Report Builder 的聚合 function 将聚合移动到服务器端,这样就可以使用 model 中的 DAX 度量,但我无法获得与 Power BI 中相同的结果。

My test data table in Power BI (named 'Table'):我在 Power BI 中的测试数据表(名为“表”):

在此处输入图像描述

My measure:我的措施:

Measure = SUMX(SUMMARIZE('Table', 'Table'[Step], "X", AVERAGE('Table'[sec])), [X])

Matrix report create in Power BI:在 Power BI 中创建矩阵报表:

在此处输入图像描述 在此处输入图像描述

After I publish the report to MyWorkspace in Power BI online I can add a connection to it in Report Builder and create a dataset with a DAX query (using Query Designer):将报表在线发布到 Power BI 中的 MyWorkspace 后,我可以在报表生成器中添加到它的连接,并使用 DAX 查询创建数据集(使用查询设计器):

在此处输入图像描述

The resulting DAX query is this:生成的 DAX 查询是这样的:

EVALUATE SUMMARIZECOLUMNS('Table'[Date], 'Table'[Step], 'Table'[sec], "Measure", [Measure])

The by using the New Matrix wizard I can crate a Tablix like this:通过使用 New Matrix 向导,我可以像这样创建 Tablix: 在此处输入图像描述

I'm expecting to get the same result as I got in Power BI Desktop, but I get the following:我希望获得与在 Power BI Desktop 中获得的结果相同的结果,但我得到以下结果: 在此处输入图像描述

Can Aggregate be used here or is there another way to calculate a Power BI models measures value for each cell of a Report Builder Tablix?可以在这里使用聚合,还是有另一种方法来计算报表生成器 Tablix 的每个单元格的 Power BI 模型度量值?

I resolved the issue by changing the query language in Query Designer from DAX to MDX.我通过将查询设计器中的查询语言从 DAX 更改为 MDX 解决了这个问题。

在此处输入图像描述

Now the result in the "Measure" columns are as expected.现在“测量”列中的结果符合预期。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM