日期PowerBI上的累积发生次数?

问题描述

数据集与此类似:

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

,

您的措施非常接近您的要求。以下是调整后的代码-

pixels[index] = ...