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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OriK
Regular Visitor

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 @OriK 

 

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

Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

@OriK 

 

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

 

orik.png


Regards
Zubair

Please try my custom visuals

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 @OriK 

 

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

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

marvelous!

Zubair_Muhammad
Community Champion
Community Champion

@OriK 

 

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

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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