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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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