SOLVED

Pivot Table

%3CLINGO-SUB%20id%3D%22lingo-sub-1518281%22%20slang%3D%22en-US%22%3EPivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518281%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I'm%20trying%20to%20build%20a%20pivot%20table%20out%20of%20the%20attached%20data.%20The%20data%20is%20in%20the%20first%20tab%2C%20and%20the%20attempt%20at%20the%20table%20is%20in%20the%20second.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20trouble%3A%3C%2FP%3E%3CP%3Ea)%20Ordering%20the%20tasks%20Task%201%20%2C%202%26nbsp%3B%20%2C%203%20etc%20in%20order%2C%20and%3C%2FP%3E%3CP%3Eb)%20I'd%20like%20to%20add%20the%20dates%20with%20the%20total%20value%20into%20columns%20in%20both%20quarters%20and%20year%2C%20and%3C%2FP%3E%3CP%3Ec)%20I%20inherited%20the%20spreadsheet%20(its%20much%20bigger%20than%20the%20excerpt%20here)%20and%20note%20that%20there%20is%20a%20hidden%20formula%2Fmacro%20that%20turns%20cells%20green%20whre%20it%20fills%20the%20criteria%20of%20having%20work%20done%20that%20week%20for%20that%20development%20service.%20I%20cant%20seem%20to%20uncover%20the%20formula%2Fmacro%20that%20does%20this%20-%20is%20there%20some%20way%20to%20do%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that%20makes%20sense%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1518281%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518386%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518386%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F726705%22%20target%3D%22_blank%22%3E%40JulianG950%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQ1%3A%20Your%20task%20names%20are%20text.%20Hence%2C%20%22Task%2010%22%20gets%20sorted%20before%20%22Task%202%22.%20Add%20a%200%20before%20single%20digit%20task%20numbers.%20Then%20%22Task%2002%22%20will%20be%20sorted%20before%20%22Task%2010%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQ2%3A%20Your%20data%20is%20already%20%22pivoted%22.%20It%20needs%20to%20be%20%22unpivoted%22%20first%2C%20so%20that%20you%20can%20put%20the%20dates%20in%20column%20headers%20and%20then%20group%20them%20by%20Qtr%20and%20Year.%20Use%20%22Get%26amp%3BTransform%20Data%22%20(a.k.a.%20as%20PowerQuery%20PQ)%20and%20PowerPivot%20to%20achieve%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQ3%3A%20The%20colouring%20of%20cells%20depending%20on%20criteria%20is%20done%20via%20Conditional%20Formatting.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20attached%20workbook%20has%20Q1%20and%20Q2%20resolved%2C%20though%20you%20may%20find%20the%20steps%20mentioned%20in%20Q2%20not%20all%20that%20straight-forward.%20Especially%20if%20you%20have%20never%20work%20with%20PQ%20before.%20First%2C%20determine%20if%20the%20outcome%20is%20what%20you%20need.%20Next%2C%20see%20if%2Fhow%20you%20can%20implement%20this%20in%20your%20real%20life%20situation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518416%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518416%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BThankyou!%20I%20will%20have%20a%20look.%20Regards.%20Julian%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518455%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518455%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERiny%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%20I've%20had%20a%20look%20and%20recreated%20the%20table%2C%20thanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20wondering%20about%20the%20date%20format%20you%20used%20in%20the%20columns%20though%20-%20did%20you%20have%20to%20do%20this%20for%20the%20data%20to%20sort%20in%20the%20PT%20in%20the%20correct%20year%20order%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ealso%2C%20and%20thank%20you%20for%20your%20patience!%20would%20there%20be%20an%20easy%20way%20to%20group%20this%20by%20month%20as%20well%20as%20quarters%20and%20years%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJulian%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518631%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518631%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F726705%22%20target%3D%22_blank%22%3E%40JulianG950%3C%2FA%3E%26nbsp%3BRegarding%20the%20date%20format%2C%20it%20doesn't%20have%20to%20be%20a%20special%20one.%20As%20long%20as%20the%20dates%20have%20a%20data%20type%20%22Date%22.%20Then%2C%20you%20can%20group%20them%20e.g.%20by%20year%2C%20quarter%2C%20month.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGrouping%20is%20done%20by%20selecting%20a%20date%20header%20in%20the%20PT%20and%20then%20%22Group%20selection%22%20in%20the%20%22PivotTable%20Analyse%22%20ribbon.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202020-07-13%20at%2014.45.38.png%22%20style%3D%22width%3A%20126px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205015i7CBA4250B10C7666%2Fimage-dimensions%2F126x92%3Fv%3D1.0%22%20width%3D%22126%22%20height%3D%2292%22%20title%3D%22Screenshot%202020-07-13%20at%2014.45.38.png%22%20alt%3D%22Screenshot%202020-07-13%20at%2014.45.38.png%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20then%20the%20grouping%20that%20you%20want.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202020-07-13%20at%2014.41.34.png%22%20style%3D%22width%3A%20186px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205016i6D562D1F997FA89C%2Fimage-dimensions%2F186x270%3Fv%3D1.0%22%20width%3D%22186%22%20height%3D%22270%22%20title%3D%22Screenshot%202020-07-13%20at%2014.41.34.png%22%20alt%3D%22Screenshot%202020-07-13%20at%2014.41.34.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EGive%20it%20a%20try%20and%20come%20back%20if%20you%20run%20into%20troubles.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520400%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520400%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BHi%2C%20thanks%20for%20the%20advice.%20Think%20I've%20got%20it%2C%20took%20a%20little%20while%20as%20I%20was%20highlighting%20all%20the%20dates%20not%20one%2C%20to%20do%20the%20grouping.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20help%20is%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJulian%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi, I'm trying to build a pivot table out of the attached data. The data is in the first tab, and the attempt at the table is in the second.

 

I'm having trouble:

a) Ordering the tasks Task 1 , 2  , 3 etc in order, and

b) I'd like to add the dates with the total value into columns in both quarters and year, and

c) I inherited the spreadsheet (its much bigger than the excerpt here) and note that there is a hidden formula/macro that turns cells green whre it fills the criteria of having work done that week for that development service. I cant seem to uncover the formula/macro that does this - is there some way to do this?

 

If that makes sense?

 

Thank you

5 Replies

@JulianG950 

Q1: Your task names are text. Hence, "Task 10" gets sorted before "Task 2". Add a 0 before single digit task numbers. Then "Task 02" will be sorted before "Task 10".

 

Q2: Your data is already "pivoted". It needs to be "unpivoted" first, so that you can put the dates in column headers and then group them by Qtr and Year. Use "Get&Transform Data" (a.k.a. as PowerQuery PQ) and PowerPivot to achieve this.

 

Q3: The colouring of cells depending on criteria is done via Conditional Formatting.

 

The attached workbook has Q1 and Q2 resolved, though you may find the steps mentioned in Q2 not all that straight-forward. Especially if you have never work with PQ before. First, determine if the outcome is what you need. Next, see if/how you can implement this in your real life situation.

 

 

Highlighted

@Riny_van_Eekelen Thankyou! I will have a look. Regards. Julian

Highlighted

@Riny_van_Eekelen 

 

Riny,

 

Hi, I've had a look and recreated the table, thanks.

 

I was wondering about the date format you used in the columns though - did you have to do this for the data to sort in the PT in the correct year order?

 

also, and thank you for your patience! would there be an easy way to group this by month as well as quarters and years?

 

Regards

 

Julian

Highlighted
Best Response confirmed by JulianG950 (New Contributor)
Solution

@JulianG950 Regarding the date format, it doesn't have to be a special one. As long as the dates have a data type "Date". Then, you can group them e.g. by year, quarter, month.

 

Grouping is done by selecting a date header in the PT and then "Group selection" in the "PivotTable Analyse" ribbon.

Screenshot 2020-07-13 at 14.45.38.png 

and then the grouping that you want.

Screenshot 2020-07-13 at 14.41.34.png

Give it a try and come back if you run into troubles.

 

Highlighted

@Riny_van_Eekelen Hi, thanks for the advice. Think I've got it, took a little while as I was highlighting all the dates not one, to do the grouping.

 

Your help is appreciated.

 

Regards

 

Julian