Forum Discussion

Applicable88's avatar
Applicable88
Icon for Impactful Individual rankImpactful Individual
4 years ago
Solved

Alternating Attributes in calculated columns

Hello,

 

I have a mastercalendar as an example. I didn't show all dates just the calendarweeks here:

CalendarweekCategory A Category B Category C
1 A B C
2 B C A
3 C A B
4 A B C

 

I want category alternating for the weeks to come. So in week one of Category A it starts with A and then B and then C and again A.

Its a regular alternating pattern. How to write this as a calculated column and also starts the other categories with B for week 1 repsectively C for Category C?

 

Thank you very much in advanced. 

Best. 

  • For Category A
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"A",1,"B",2,"C")
    
    For Category B
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"B",1,"C",2,"A")
    
    For Category C
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"C",1,"A",2,"B")

1 Reply

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional
    For Category A
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"A",1,"B",2,"C")
    
    For Category B
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"B",1,"C",2,"A")
    
    For Category C
    =SWITCH(MOD(Table1[Calendarweek]-1,3),0,"C",1,"A",2,"B")