Forum Discussion
Counting the same values until encountered other.
- Anonymous6 years ago
Here is the steps:
1. Add an Index column in Query Editor,
2. Add a Rank column
Rank = RANKX(FILTER('Table',[test number]=EARLIER('Table'[test number])),[Index],,DESC)3. Create the measuresCountout = CALCULATE(COUNT('Table'[result]),FILTER('Table',[result]="out"))+0
countintoout = IF([Countout]=0,COUNT('Table'[result]),CALCULATE(MIN('Table'[Rank]),FILTER('Table',[result]="out"))-1)
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
I'm having trouble opening a file from you. Can you insert a file that is not on OneDrive or screenshots of the table and measures.
Here is the steps:
1. Add an Index column in Query Editor,
2. Add a Rank column
Countout = CALCULATE(COUNT('Table'[result]),FILTER('Table',[result]="out"))+0
countintoout = IF([Countout]=0,COUNT('Table'[result]),CALCULATE(MIN('Table'[Rank]),FILTER('Table',[result]="out"))-1)
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- ewelinag176 years agoFrequent Visitor
Anonymous
What measures will look like when empty values appear. The appear at the end of the test numbers.
The end result should be as you have obtained.
- Anonymous6 years agoNot applicable
I guess you could still try the same formulas, because blank is also considered as a row value in power bi and the formula only looks for the "out “value, so ”in“ and ”blanks“ does not really matter.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.