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
csudude
Frequent Visitor

Start Of Week

I'm in the processing of migrating my companies reports from Tableau to Power BI. However, I'm new to Power BI and I have a lot to learn. 

 

In Tableau, I can quickly select the start of the week.  This is from Tableau Desktop: 

image.png

 

Is there a way to do this in Power BI Desktop? I am trying to filter on the last 12 calendar weeks.  Below is a screenshot from Power BI, it shows 7/14 as the start of the week.  That is a Sunday.  However, I'd like to tell Power BI that Monday is the start of the week and should show 7/15: 

image.png

Any suggestions? 

 

5 REPLIES 5
csudude
Frequent Visitor

Thanks for the replies.

 

@v-lid-msft Your information is helpful but not for this particular problem.  In addition to setting Monday to the start of the week, I need to filter on the last 12 weeks.  I need relative date filtering which I cannot do on an integer. 

 

I created a start of week date column in my date table that sets Monday to the start of the week: 

SoW = Dates[Date] - WEEKDAY(Dates[Date],2) + 1

 

After that, I used my SoW column in the date filter:

image.png

However, the filter still shows 7/14 (Sunday) to 10/5 (Saturday) and not 7/15 to 10/6 like I would prefer. Internally, Power BI is still recognizing Sunday as the start of the week. That's why I was hoping PBI had something like Tableau where I can tell Tableau Desktop / the data source that Monday is the start of the week and filters would reflect that.  

 

The good news is despite the incorrect dates being displayed in the filter, I am getting the values I expected.  I was worried that for the week of 9/30 (Monday) values for 10/6 (Sunday) would be excluded due to the filter showing 7/14/19-10/5/19.

 

Hi @csudude ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @csudude ,

 

We can create a parameter as a workaround to meet your requirement.

 

29.PNG

 

Then create a measure to judge the condition:

 

isInLastWeek =
IF (
    ISFILTERED ( LastWeekNumber[LastWeekNumber] ),
    IF (
        MAX ( 'Table'[Week] )
            >= WEEKNUM ( TODAY (), 2 ) - [LastWeekNumber Value]
            && MAX ( 'Table'[Week] ) <= WEEKNUM ( TODAY (), 2 ),
        1,
        0
    ),
    1
)

Put it into the Visual Filter and set greater than 0.

 

30.PNG


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @csudude ,

 

We can add a calculated column based on your date column, get the weeknumber start by Monday.

 

Please read this document to get detail about WEEKNUM function: https://dax.guide/weeknum/

 

Week = WEEKNUM([Date],2)

17.PNG18.PNG

 

Then you can create silcer based on this column.

 

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

I have written a bunch of quick measures for things like this:

 

https://community.powerbi.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=fals...

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.