Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
My dataset has no date column, but contains Dayofweek from Number 1 to 7.
I want to Create a Column that Returns Monday to Friday instead.
I had to use IF then Function (like shown in the image below) to get this. But i Know there is a better and more efficient way to get this using a simple Dax formula.
Probably, takes the Number like 1 and Return Monday in a column. i would appreciate if i could get your suggestions
Solved! Go to Solution.
Hi @driplytics ,
As @tamerj1 mentioned before, you can use switch like this:
Weekday =
SWITCH (
[DayOfWeek],
1, "Monday",
2, "Tuesday",
3, "Wedensday",
4, "Thursday",
5, "Friday",
6, "Saturday",
7, "Sunday"
)
Output:
Also, you can create a new table like this:
Table =
SELECTCOLUMNS (
CALENDAR ( TODAY (), TODAY () + 6 ),
"Weekday", FORMAT ( [Date], "dddd" ),
"DayOfWeek", WEEKDAY ( [Date], 2 )
)
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @driplytics ,
As @tamerj1 mentioned before, you can use switch like this:
Weekday =
SWITCH (
[DayOfWeek],
1, "Monday",
2, "Tuesday",
3, "Wedensday",
4, "Thursday",
5, "Friday",
6, "Saturday",
7, "Sunday"
)
Output:
Also, you can create a new table like this:
Table =
SELECTCOLUMNS (
CALENDAR ( TODAY (), TODAY () + 6 ),
"Weekday", FORMAT ( [Date], "dddd" ),
"DayOfWeek", WEEKDAY ( [Date], 2 )
)
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
30 | |
18 | |
15 | |
7 | |
6 |