电源BI过滤数据具有独家条件

发布于 2025-02-09 03:18:48 字数 1171 浏览 1 评论 0原文

这是我被问到的卷曲问题,我不确定如何在PowerBi中解决它(我正在帮助的用户专门使用它,因此我没有选择更舒适的编程语言)。

我们的情况(例如)他们希望根据所选治疗方法和该处理的响应值过滤化合物名称。到目前为止,基本切片机都很好。

但是,他们希望仅看到那些针对特殊选择的治疗范围内有反应的化合物,如果另一种治疗方法在该范围内也有反应,他们希望掉落该化合物。

例如,下表是我合成的东西,给出一个简单的例子:

复合治疗响应
1A13.80
1B8.25
1C9.22
1D10.50
2A11.66
2B8.42
2C12.63
2D9.63

在这种情况下,我有A复选框切片机进行处理和滑块切片机以进行响应。如果我为响应指定11-14的范围,那么当前的行为是我具有处理A和处理A的化合物1,并用处理A和C。 1和2进行治疗A。

所需的行为将仅具有处理A的化合物1,因为化合物2在该范围内也具有治疗C。

我觉得这可能是适当的DAX可行的,但我不知道从哪里开始。

This has been a curly question I have been asked and I am unsure how to tackle it in PowerBI (the user I am helping is specifically using it so I don't have the option to lean on a more comfortable programming language).

We have a situation where (for example) they are wanting to filter for compound names based upon a selected treatment and a response value from that treatment. So far so good with basic slicers.

HOWEVER they then wish to see ONLY those compounds that have a response in the correct range for the specifically chosen treatment, and if another treatment has a response in that range too, they wish to drop that compound.

For example, the following table is something I synthesized that gives an easy example:

CompoundTreatmentResponse
1A13.80
1B8.25
1C9.22
1D10.50
2A11.66
2B8.42
2C12.63
2D9.63

In this case, I have a checkbox slicer for treatment and a slider slicer for response. If I specify a range of 11 - 14 for the response, the current behaviour is that I have compound 1 with treatment A and compound 2 with treatment A and C. Then if I select Treatment A for the treatment slicer, I just have both compound 1 and 2 with treatment A.

The desired behaviour would be to have ONLY compound 1 with treatment A because compound 2 has treatment C within this range too.

I feel like this is probably doable with an appropriate DAX but I don't know where to start with this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无敌元气妹 2025-02-16 03:18:48

如果我正确理解,则只需要compound,而治疗较少。

创建一个新的度量:

Rank = 
RANKX(
    'Table',
    CALCULATE(
        COUNTROWS('Table'),
        REMOVEFILTERS('Table'[Treatment])
    ),
    ,
    TRUE,
    SKIP
)

它对给定化合物的结果排名(即表中的线)。

然后,您将此新措施添加到“过滤器”区域中的“过滤器”区域中。然后将过滤器设置为1

If I understood correctly, you want the Compound with the less treatment(s) only.

Create a new measure:

Rank = 
RANKX(
    'Table',
    CALCULATE(
        COUNTROWS('Table'),
        REMOVEFILTERS('Table'[Treatment])
    ),
    ,
    TRUE,
    SKIP
)

It ranks the number of results (ie. lines in the Table) for a given Compound.

Then, you add this new measure in the Filters bar, in "Filters on this visual" zone. And you set the filter to 1.

Illustration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文