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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Add + 1 to previous row

Hi All

 

I was able to create the "Cycle" column using this formular in MS Excel: =IF(A2=A1;IF(B2 = "Reboot";C1+1;C1+0);0). Basically, if the name in the current row matches the name in the previous row, the proceed but if not then 0. The formular proceeds to add 1 to subsequent tasks when TaskName  = Reboot. It's quite easy in Excel, but can it be done in Power BI? 

 

NameTaskNameCycle
MtsweniEnrol0
MtsweniInvite0
MtsweniReboot1
MtsweniConsult1
MtsweniReboot2
MtsweniRecord BC2
MtsweniRecord BC2
MtsweniFarewell2
MtsweniConsult2
MtsweniReboot3
MtsweniConsult3
MtsweniConsult3
ThabisoEnrol0
ThabisoInvite0
ThabisoSent Reminder0
ThabisoReboot1
ThabisoSend Materials1
ThabisoReboot2
ThabisoRecord BC2
ThabisoRecord BC2
ThabisoFarewell2
ThabisoConsult2
ThabisoReboot3
ThabisoConsult3
ThabisoConsult3
ThabisoComprehensive Diabetes Tests3
ThabisoSend Materials3
PaulEnrol0
PaulInvite0
PaulSend Materials0
PaulWelcome0
PaulReboot1
PaulRecord BC1
PaulReboot2
PaulRecord BC2
PaulRecord BC2
PaulFarewell2
PaulConsult2
PaulReboot3
PaulConsult3
PaulConsult3
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @thabz_mogale,

 

Please check following calculated column as below and see if it meet your exception:

 

Cycle =

CALCULATE (

    COUNTROWS ( 'Table' ),

    FILTER (

        'Table',

        'Table'[Name] = EARLIER ( 'Table'[Name] )

            && 'Table'[Index] <= EARLIER ( 'Table'[Index] )

            && 'Table'[TaskName] = "Reboot"

    )

) + 0

 

Result would be shown as below:

1.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @thabz_mogale,

 

Please check following calculated column as below and see if it meet your exception:

 

Cycle =

CALCULATE (

    COUNTROWS ( 'Table' ),

    FILTER (

        'Table',

        'Table'[Name] = EARLIER ( 'Table'[Name] )

            && 'Table'[Index] <= EARLIER ( 'Table'[Index] )

            && 'Table'[TaskName] = "Reboot"

    )

) + 0

 

Result would be shown as below:

1.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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