How to get Week Commencing

Cantona_lives

New Member
Joined
Nov 27, 2013
Messages
20
Hi all,
I am starting to learn about PowerPivot and the value it can provide, but I am hitting a few roadblocks that some kind person can possibly help me with.

So I have a SQL query that pulls in 'Name', 'Task' and 'Finish Date' from an external source.

I would like to be able to have 'Week commencing' running across the pivot table columns and then 'finish date' appearing in the value of the date within which it falls.

Something like this :

Week Commencing
Name Task Finish Date 29/12/2014 | 05/01/2015 | 12/01/2015
Test1 Task 1 01/01/2015 Yes No No

Of course a number or anything in the value section would work as I am attempting to create a timeline.


I have managed to pull all the week commencing in as a table, but getting them to link other than just as a date is the challenge. In other words, I can display dates, but no values. Therefore I am missing a vital piece of the relationship.

Hope that makes some level of sense?


Thanks in advance for any advice.


-CL
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
To qualify futher,

I could easily add dates as a manual entry and then use the 'AND' formula to calculate where x row has a date less than week commencing and more than week commencing, however using dates in this manner would make for purely manual updates of week commencing and would prevent filters by date.
 
Upvote 0
You could add a calculated column in the PP datamodel to get the Monday of the Finish Date,

W/c Date:=[Finish Date]-(weekday([Finish Date])-2)

and then in your pivot either use that as the column header and do a count of Finish date in the values, or use the dates from date table (if linked to your main table).
 
Upvote 0
Thanks, that worked to a point.


I would like all week commencing to display regardless of whether they are populated or not - Is that achieveable?

So far I am seeing that if a week commencing does not have a date associated, it does not display.

-CL
 
Upvote 0
Yes, you would need to use the dates in your dates table as column headings, and then goto Pivottable Options>Display>Show items with no data on columns.
 
Upvote 0
Yes had susequently located. Now just have a date issues with some dates pulling through time as well as date, despite the format being dd/mm/yyyy.

Thanks,

-CL
 
Upvote 0
You will want to nuke those times on their way out of SQL. cast(DateColumn as Date) as [Date] or whatever. If you want the times for other reasons... put it in a separate column.
 
Upvote 0

Forum statistics

Threads
1,216,057
Messages
6,128,524
Members
449,456
Latest member
SammMcCandless

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top