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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Custom WEEKDAY based on users selection / preference

Hi all,

 

I want to give my user a choice which day of the week the week starts with. I have a normal calendar table where all my dates are being displayed as well as the day name, month, quarter, year etcetera. This table is been created in Power Query and then loads into the datamodel. It is connected with several tables who are using the calendar table for displaying data on a timebases. See the full code below in the attached image.

power-bi-date-table.PNG

 

 

 

But the problem is that I have set a hardcoded week start day in Power Query. This is ba sed on the settings that I determine. So now every week starts on a Monday and ends on a Sunday. The code to determine the week start day is as followed:

InsertDayWeek = Table.AddColumn(InsertDayInt, "Day Num Week", each Date.DayOfWeek([Date], 1) + 1, type number),

 

I want my user to give an option which day a week has to start with so it could choose between any day of the week. I prefer to solve this with a slicer or filter which will be available in the report. But if there are also other options possible I would like to hear this too. 

 

I tried to find some solutions on the internet but have only managed to find one example which asked the same as what I want to have: User to Select Week Start Day 

I tried to get this working but it did not work for me because this solution requires a new table. And I would like to

display all my data based on my main Calandar table. 

 

I have also tried to use a calculated column with the weekday function of DAX and to have a dynamic number as <return_type>. But unfortunately a calculated column does not support measures into this. 

 

If you need more information please let me know.

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous Right, you would have to use a measure to perform this function. Hard to be more specific without knowing more about your data model. One method might be to essentially recreate a simple calendar inside the measure using CALENDAR for example, use ADDCOLUMNS to add in your desired columns for week information based on the start of week selected by the user. You would then figure out the dates and then filter your base calendar table according to those dates using something like CALCULATE or CALCULATETABLE. Again, hard to be specific about without a solid use case.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Sorry for my late response, thank you for your reply.

 

What specific information do you need more from me other than the code, which I use to create my date table with Power Query, I send in my first post. 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.