Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Counts if value is not blank and then start again

Hi i have a set of data from different dates and for each date there is milliseconds. 

what i am trying to achieve is a cumulative count until my first  blank and then start again from 1

 

Desired result:

Diff

New Column

21.1

1

21.2

2

21.3

3

Null

Null

25

1

25.2

2

26

3

27

4

 

 

P.BI.png

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

You can use this Custom Column.

See file attached as well

 

=let myindex=[Index] in
Table.RowCount(Table.SelectRows(#"Added Custom1",each [Custom]=null and [Index]<=myindex))+1

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Please see attached file's Query Editor for clarity as well

 

orik.png

Anonymous
Not applicable

Hi, thanks allot, maybe you can also help me crate this column:

Thanks again

 

Diff

Index

Sprint No

21.1

1

1

21.2

2

1

21.3

3

1

Null

Null

Null

18

1

2

18.1

2

2

19

3

2

20

4

2

Null

Null

Null

 

 

 

Hi @Anonymous 

 

You can use this Custom Column.

See file attached as well

 

=let myindex=[Index] in
Table.RowCount(Table.SelectRows(#"Added Custom1",each [Custom]=null and [Index]<=myindex))+1
Anonymous
Not applicable

marvelous!

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Assuming you have an Index Column starting from 0, I believe you can use this Custom Column from Query Editor

Replace AddedIndex with the PreviousStep name in your Query Editor

let myindex=[Index] in
let mytable=Table.SelectRows(AddedIndex,each [Index] < myindex and [Diff]=null)
in
if [Diff] <> null then if Table.IsEmpty(mytable)=false then [Index]-Table.Max(mytable,"Index")[Index] else [Index]+1 else null

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.