cancel
Showing results for 
Search instead for 
Did you mean: 
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 IV
Super User IV

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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors