Forum Discussion
DaanBos
2 years agoFrequent Visitor
Count occurrences until certain value
Dear all, I want to count the iterations required to get an amount of 50 throughput. Below is the code I created. But the problem now is that it gives the same value in the entire column. Does an...
DaanBos
2 years agoFrequent Visitor
In the meantime, they have come up with a measure that seems to work, but with the wrong results.
Here's the code:
CountItmes =
CALCULATE(
COUNTAX(
VALUES('Iterties'[Iteratie]),
VAR RandomSelection = RANDBETWEEN(1, COUNTROWS(VALUES('Iterties'[Iteratie])))
VAR ThroughputNeeded = 20
RETURN
IF (
SUMX(
FILTER(
'Iterties',
RANKX(VALUES('Iterties'[Iteratie]), 'Iterties'[Iteratie], , ASC) <= RandomSelection
),
'Iterties'[Throughput]
) >= ThroughputNeeded,
1
)
)
)