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
Olia
Helper III
Helper III

Changing DayOfWeek to show Monday as 1 and Sunday as 7

Hello everyone,

 

I've just started using PowerBI (literally about half an hour ago), and the tutorial data that I'm using is showing DayOfWeek for 1-1-1999 as 4th day of the week, and the column also contains 0s as day of the week. Now 1-1-1999 was a Friday, so I'd really love it if the dataset could show me Friday as 5, Sunday as 7 and Monday as 1.

 

Is there a newbie-friendly way of doing this? Or should I come back to this after I've leartned R / M / Python / DAX (whichever applies)?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

unfortunately it's not that easy (w/o knowing M, DAX, R, or Python) to change this 🙂

 

Kidding, just a little DAX is necessary

 

I guess you have a separate table that represents the complete calendar.

 

The problem you are facing, is the following: the creator of the data that your are using created this calendar table, was thinking that Monday is best represented by 0. I also met a person decades ago that was thinking a similar thing, maybe it was the same person.

 

If you dare you could create your own (maybe your first calculated column by doing the following:

  1. Goto the Data window (the 2nd symbol on left vertical bar)
  2. Mark the Calendar table that represents your calendar
  3. Open the context menu of that table and choose "New Column"
  4. Enter the following DAX Formula
my Week starts on Mondays counting 1 = WEEKDAY('Calendar'[Date],2)

This will create a new column in your table, here is a screenshot that shows me entering the formula with the available options of the formula WEEKDAY

image.png

 

Please be aware that the learning track/material you are following may contain exercises that for some reason expect that Mondays count as 0.

 

Happy learning

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

14 REPLIES 14

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.