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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sureshsonti
Helper II
Helper II

DAX Weekday Name UTC Current Year Today and Last Year Today

Hello,
I am trying to extract the Weekday Name (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) for Current Year Today and Last Year Today. I used this formula =UPPER(FORMAT(TODAY(). "dddd")). This formula works for TODAY but at 7 PM in the evening it automatically moves to the next day when I upload my PBIX file to Power BI Services. It has something to do with UTC NOW function.

So I am trying to extract WEEKDAY Today's Day (Monday) 12/24/2018 and Last Year's Day (Sunday) 12/24/2017

My database has these fields. (Order Date, Location, Year, Month, Units Sold)

 

Thanks for your help

1 ACCEPTED SOLUTION

HI @sureshsonti,

 

According to your formula, I can confirm your formula is try to get the last year number and format it as day of week.

 

I'd like to suggest you try to use following formula to get correct day of week of last year same day.

 

Last Year Weekday Name as of Today =
UPPER (
    FORMAT (
        DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) ),
        "dddd"
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Try thid

 

=UPPER(TEXT(EDATE(TODAY(),-12),"dddd"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ashish

The first formula worked for me, ( Current Year Weekday Name as of Today = UPPER(FORMAT(TODAY(), "dddd")) but because of UTC NOW now it is showing TUESDAY instead of MONDAY. My Power BI Desktop still shows MONDAY. I have attached an image of the Power BI Service screenshot. I am looking for a formula that will still show MONDAY till 11.59 PM of 12/24/2018 and should change to TUESDAY after 12.00 AM

 

Last Year Weekday Name as of Today = UPPER(FORMAT(YEAR(TODAY())-1, "dddd"))   (This formula worked for Last Year Weekday Name

 

 

UTCNOW.JPG

 

 

HI @sureshsonti,

 

According to your formula, I can confirm your formula is try to get the last year number and format it as day of week.

 

I'd like to suggest you try to use following formula to get correct day of week of last year same day.

 

Last Year Weekday Name as of Today =
UPPER (
    FORMAT (
        DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) ),
        "dddd"
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Mr. Sheng,

You are absolutely right. Your formula worked. Thanks for your help. You are awesome

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.