Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Character for Weekday unique

Hi

 

How can I change Weekday to following structure

 

 

 

Regards

H.

  • Anonymous's avatar
    Anonymous
    8 years ago

    HI Anonymous,


    You can use switch function with weekday to replace display characters.

    SWITCH(WEEKDAY([Date],2),1,"M",2,"Ti",3,"O",4,"T",5,"F",6,"L",7,"S","")

     

    Sample calendar:

     

    Calendar = ADDCOLUMNS(CALENDAR("1/1/2018","12/31/2018"),"WeekNum",WEEKNUM([Date],2),"WeekDay",SWITCH(WEEKDAY([Date],2),1,"M",2,"Ti",3,"O",4,"T",5,"F",6,"L",7,"S",""))

     

    Regards,

    Xiaoxin Sheng

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,


    You can use switch function with weekday to replace display characters.

    SWITCH(WEEKDAY([Date],2),1,"M",2,"Ti",3,"O",4,"T",5,"F",6,"L",7,"S","")

     

    Sample calendar:

     

    Calendar = ADDCOLUMNS(CALENDAR("1/1/2018","12/31/2018"),"WeekNum",WEEKNUM([Date],2),"WeekDay",SWITCH(WEEKDAY([Date],2),1,"M",2,"Ti",3,"O",4,"T",5,"F",6,"L",7,"S",""))

     

    Regards,

    Xiaoxin Sheng

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi

     

    Thanks for your reply.

     

    I need to give you some more specification.

     

    I imported a excelsheet with following format. As you see t appears twice within a week.

     

     

    Output in Power BI appears as follows. t appears only once.

     

     

    The excelimport file does not contain Dates only week no with m, t, o, t, f, l, s (first character of weekday)

     

    Is there a way to solve this so that you get m, t, o, t, f, l, s or m, ti, o, t, f, l, s

     

    Many thanks

     

    Regards

    Henrik