web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get weekday from numbe...
Power Apps
Unanswered

Get weekday from number 0-6?

(0) ShareShare
ReportReport
Posted on by 664

I'd like to convert a weekday stored as a number 0-6 as text value of a weekday. I thought I'd be able to use the text function to convert like this:

Text(0, "dddd")

to get value Sunday. Instead, regardless of what I have as the first parameter, the value returned (I'm using a label) is Wednesday. Is there any other way to make this conversion besides an If statement? (If(weekday = 0, "Sunday, If(weekday = 1, "Monday", ...)

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    You can try Switch, here us a link to some info about Switch:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

    If you have already tried this and are looking for other potential solutions, let me know.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • Cooper01 Profile Picture
    664 on at

    Thanks. I am aware of Switch too, I just wanted to make sure there wasn't a cleaner or built in way to make the conversion

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @Cooper01 

    You can use this formula

     

    Set(YourNumber0Through6, 0);
    Text(DateAdd(DateValue("1/1/2017"),YourNumber0Through6,Days),"dddd")

     

    I only used '1/1/17' because it is a Sunday. You can use any Sunday.

    This also works, if it feels cleaner to you. Just replace the 0 with your value.

    Text(DateAdd(DateValue("7"),0,Days),"[$-en-US]dddd")

    ---
    If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard