使用PowerBi Dax创建动态计算的列
我是PowerBi的新手,在创建一个计算出的列方面,我面临着一个挑战,该列将随着数据集被过滤而自动更新。我的数据集看起来像这样 -
我已经使用公式创建了ablevarable_milestone_match列 -
Deliverable_Milestone_Match =
IF(
Sheet1[Issue_Type] = "CO Deliverable",
VAR _sel = SELECTCOLUMNS(
Sheet1,
"MilestoneIssueKey",
[Issue_Key]
)
RETURN
IF(
Sheet1[MilestoneIssueKey] IN _sel,
"MAPPED",
"UNMAPPED"
),
"MILESTONE"
)
现在,挑战是,我需要在此数据集中应用一些过滤器,并且由于我的计算列引用了其他列中的其他列,数据,它也需要相应更改。例如,该公式正在查找esseage_key中MilestoneIssuekey的存在,如果匹配匹配,则填充映射,否则将其取消启动。现在,如果我应用一个删除特定唯一essue_key的过滤器,则相应的MilestoneIssueKey将不再具有匹配项,并且deliverable_milestone_match值现在应该更改为未上限。
如果有人可以帮助我,我将不胜感激。我什至不确定是否可以通过DAX实现这一点,或者我是否需要为此使用电源查询。
提前致谢!
I am new to PowerBI and I am facing a challenge with creating a calculated column that will get updated automatically as the dataset keeps getting filtered. My dataset looks like this -
I have created the Deliverable_Milestone_Match column using the formula -
Deliverable_Milestone_Match =
IF(
Sheet1[Issue_Type] = "CO Deliverable",
VAR _sel = SELECTCOLUMNS(
Sheet1,
"MilestoneIssueKey",
[Issue_Key]
)
RETURN
IF(
Sheet1[MilestoneIssueKey] IN _sel,
"MAPPED",
"UNMAPPED"
),
"MILESTONE"
)
Now, the challenge is, that I will need to apply some filters to this dataset, and since my calculated column references other columns in the data, it also needs to change accordingly. For example The formula is looking up the presence of MilestoneIssueKey in Issue_Key, and it is populating MAPPED if it gets a match, and UNMAPPED otherwise. Now, if I apply a filter that removes a specific unique Issue_Key, then the corresponding MilestoneIssueKey won't have a match anymore, and the Deliverable_Milestone_Match value should change to UNMAPPED now.
I would appreciate it if anyone can help me with this. I am not even sure if this can be achieved via DAX or whether I will need to use Power Query for this.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的第一个问题是以下内容:
计算出的列不会随着滤波器上下文的发展而自动更新计算出的列。正如解释的那样在这里
因此,在这方面,您应该尝试使用措施来解决问题。
You first issue is the following:
Calculated columns aren't refreshed dynamicaly as filter context evolves. As explained here :
So, in that regard you should try to solve your problem using Measures.