简体   繁体   English

尝试根据不相关表 Power BI 钻取的 Max() 值创建计算表

[英]Trying to create a calculated table based on Max() values of a drill through of an unrelated table Power BI

In Power BI, I'm trying to use a measure to take the = MAX(CallDetails[Date]) that is left once I drill through on a visual.在 Power BI 中,我尝试使用一个度量来获取在视觉对象上钻取后剩下的= MAX(CallDetails[Date])

To create a calculated table.创建计算表。 That is a filtered version of an unrelated table AgentActivities by [Max Date] .这是[Max Date]对不相关表AgentActivities的过滤版本。

My goal is to create 2 visuals side by side of the calls that came in on a select day with the agents that were available to take them.我的目标是在 select 一天打来的电话与可以接听电话的代理一起创建 2 个视觉效果。

I've tried quite a few vairants of this but this is essentially what i'm trying to do:我已经尝试了很多这个,但这基本上是我想要做的:

FilteredAgentActivity =
var MaxDate = [Max Date]
return
FILTER('AgentActivity',AgentActivity[Date] = MaxDate)

--This does not return any results --这不会返回任何结果

if I hard code the date I get the desired result:如果我硬编码日期,我会得到想要的结果:

FilteredAgentActivity =
FILTER('AgentActivity',AgentActivity[Date] = DATEVALUE("2020/04/18"))

At this point, I'm beginning to think using a measure as a filter expression might just not compatible with what I'm trying to achieve.在这一点上,我开始考虑使用度量作为过滤器表达式可能与我想要实现的目标不兼容。 Does anyone know where I'm going wrong or a better way of doing this?有谁知道我哪里出错了或更好的方法吗?

Thanks Ben谢谢本

Hard coding date works硬编码日期有效

Measure variable fails测量变量失败

A calculated table cannot be dynamically dependent on report filtering since these are only computed when the data is initially loaded into your model (or when you refresh this data) but not whenever you change a filter.计算表不能动态依赖于报表过滤,因为这些仅在数据最初加载到您的 model 时(或刷新此数据时)计算,而不是在您更改过滤器时计算。

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

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