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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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