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
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
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.