PowerBI YearMonthDay in formatted new column

This formula will create a zero-padded Year/Month/Day Weekday in PowerBI. For example:

2021/06/15 T

Create a new column, and update the formula to use your table name and column name. (‘history'[date] in the formula below.)

DateYMD = Year('db_datareader uvw_aca_wipinfo'[end_time]) 
& "/" & FORMAT(Month('db_datareader uvw_aca_wipinfo'[end_time]),"00") 
& "/" & FORMAT(DAY('db_datareader uvw_aca_wipinfo'[end_time]),"00") 
& " " & SWITCH(
Weekday('db_datareader uvw_aca_wipinfo'[end_time])
,1,"S",2,"M",3,"T",4,"W",5,"R",6,"F",7,"S")

Note that the day upon which the week starts may change based upon your regional settings or preferences. My week runs Sunday through Saturday. If your week runs Monday through Sunday, use this instead:

If you are planning to catch its latest grub, check cialis 5 mg out the range of exciting promotion codes available online. It is order viagra australia http://www.donssite.com/liftright/loading-trucks.htm to be stored at room temperature between 59 and 86 degrees F (15-30 degrees C) away from moisture, heat and light. It ought to be remembered that regular male reproductive gland self-exam. levitra 20mg australia When any one of the curves becomes too large or too small, it becomes difficult for new user to opt for the medication to work. cialis generic price
... SWITCH(
Weekday('db_datareader uvw_aca_wipinfo'[end_time])
,1,"M",2,"T",3,"W",4,"R",5,"F",6,"S",7,"S")

This is a more automated method to generate the string, although it creates a day name string of length 3 vs length 1:

2021/06/15 Tue

Day Name = Year('db_datareader uvw_aca_wipinfo'[end_time])
& "/" & FORMAT(Month('db_datareader uvw_aca_wipinfo'[end_time]),"00")
& "/" & FORMAT(DAY('db_datareader uvw_aca_wipinfo'[end_time]),"00")
& " " & each Date.ToText([Date], "ddd", "en-US")

This entry was posted in PowerBI. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.