在Power BI中计算一个计数,考虑两个日期列。

huangapple go评论76阅读模式
英文:

Calculate a count in Power BI considering two date columns

问题

我有一个包含3列的表格,Case ID、Createdon和modifiedon。我想要使用modifiedon来计算每周的Case数量,但是这些Case不应该在同一周内创建。我可以轻松地针对任何单个数据点执行此操作,但如何在周趋势中实现呢?

仅仅为了详细说明问题。如果你看下面的图片,我有casenumber、createdon和modifiedon。现在我已经在柱状图上选择了7月2日。我希望它给我一个计数,其中modifiedon在7月2日至9日之间,而createdon不应在同一时间段内,所有在7月2日至9日之间创建的案例都应被排除在外。我可以创建一个度量,并要求排除当前周,但这只适用于单个时间点。我想要实现的是,无论我点击柱状图上的任何特定周,它都会显示在该周内修改的案例,排除了在同一周内创建的案例。

英文:

I have a table with 3 columns, Case ID, Createdon, modifiedon. I want to calculate a weekly count of Cases by using modifiedon but cases shouldn't have been created in the same week. I can easily do this for any single data point, but how do I achieve this for a weekly trend.

Just to elaborate on the problem. If you see the image below I have casenumber, createdon, and modifiedon. Right now I've selected 2nd July on the bar graph. I want it to give me a count of cases where modified on is the week bw 2nd & 9th and createdon shouldn't be between the same time period, all the cases where created on is bw 2nd & 9th should be removed. I can create a measure and ask it to exclude the current week but it'll just be for a single point in time. I want to achieve whenever I click on any particular week on the bar graph, it shows the cases modified in that week, excluding the cases which were also created in the same week.

在Power BI中计算一个计数,考虑两个日期列。

答案1

得分: 0

我通过创建一个新的周数列并根据它进行筛选来解决了这个问题。

英文:

I solved it by creating a new week number column and filtering out based on it.

huangapple
  • 本文由 发表于 2023年7月10日 16:41:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76652098.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定