powerbi - PowerBI 日期累计发生次数?

标签 powerbi dax powerbi-desktop cumulative-sum find-occurrences

数据集类似于:

ID          Milestone
id1         01/01/2020
id2         02/01/2020
id3         04/01/2020
id4         null
id5         02/01/2020
id6         12/01/2020

我正在尝试计算在特定日期之前达到里程碑的记录数,换句话说,计算累计发生次数。我目前有这个 DAX 指标:

#Measure = 
calculate(
    COUNTROWS(table), 
    filter(
        table, 
        table[milestone].[Date] <= MAX(table[milestone].[Date])
    )
)+0

但这似乎没有给我想要的结果:

Picture of table

如您所见,它不会将先前发生的计数添加到当前日期计数中。

提前致谢

编辑:

使用 msta42a 提供的反馈后的示例: enter image description here

最佳答案

这对我有用:

Measure = calculate(COUNTROWS('Table')
,FILTER(ALL('Table'[Mileston]), not(ISBLANK('Table'[Mileston])) && 'Table'[Mileston]<= 
SELECTEDVALUE('Table'[Mileston])))

enter image description here

关于powerbi - PowerBI 日期累计发生次数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64461579/

相关文章:

powerbi - 从一个表获取值并根据其他列放入其他表 DAX/Power Query M

asp.net - PowerBI Desktop 在获取 OData API 时返回 404,但在 Fiddler 中工作正常

azure - Power BI - 计算摊余成本

powerbi - 电力商务智能。删除重复项但保留空值

date - 如何将秒转换为 hh :mm format in Power Bi?

powerbi - 如何计算 DAX/PowerBI 中的滚动平均值?

powerbi - 电源BI : Top 5 clients Profit% chart wrong due to clients sharing multiple branches

javascript - OAuth 身份验证 - 使用 JavaScript 的访问 token (CORS 策略)错误

azure - 现有 PBIX PBI 文件连接到 Azure SQL 数据库 Power BI 服务

python - 从已发布的 Power BI 视觉对象中抓取数据