cancel
Showing results for
Did you mean:
Level 8

## Get weekday from number 0-6?

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", ...)

1 ACCEPTED SOLUTION

Accepted Solutions
Level 10

## Re: Get weekday from number 0-6?

You can use this formula

``````Set(YourNumber0Through6, 0);

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")``

---

3 REPLIES 3
Super User

## Re: Get weekday from number 0-6?

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.

---

Thanks!
Hardit Bhatia
Level 8

## Re: Get weekday from number 0-6?

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

Level 10

## Re: Get weekday from number 0-6?

You can use this formula

``````Set(YourNumber0Through6, 0);

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")``

---

Announcements

#### 'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

#### Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,485)