# Thinks all my dates are text for sorting



## masplin (Apr 10, 2012)

Powerpivot seems great for handling the data but the functionlity seems awful. I might give up with this, but hopefully I'm just being stupid. I have a column called "registration Date". Powerpivot has it as a date and I have formated it mmm-yy. So far so good.

If I create a pivot table using this field I have 2 problems
1. The date format is dd/mmm/yy. There is no function as in pivot to change the display of these units and selecting the cells and doing format cells makes no difference. I seem to be stuck with an unreadable date format.
2. Possible related, but when I go to sort it only has A to Z when I was expecting oldest to newest, as they are dates. If I sort it puts Mar11 next to Mar12.

My conconclusion is that for some reason it thinks these date fields are text so can't format them or sort them. Now becoming a useless tool quite quickly.

Thanks for any advice

Mike


----------



## masplin (Apr 10, 2012)

Well seems it is knackered in the 2008 version. I tried the 2012 beta and a small imporvement that if I format the date in powerivot the format turns up in the pivot table. However still not sortable. Also which idiot left out mm-yy as a format and gave us 40 I never use!!!

So is this possible to sort in 2012 beta or still useless?


----------



## powerpivotpro (Apr 10, 2012)

The 2012 version allows you to sort one column by another column, which is incredibly freeing.  I cover it briefly here:

http://www.powerpivotpro.com/2011/07/powerpivot-v2-ctp3/

By the way, it is now officially released, no longer a beta:

http://www.powerpivotpro.com/2012/03/powerpivot-v2-is-released/


----------



## masplin (Apr 11, 2012)

Its the actual pivot table output rows I want to sort not the powerpivot data.  I have formatted my dates mmmm yy and want the most recent at the top i.e. April 12. My only choice is Z-A so have to do it manually. Seems really basic functionality to be missing.


----------



## powerpivotpro (Apr 11, 2012)

Sorry I wasn't clear.  That new feature in 2012, "sort column 1 by column 2," was only introduced in order to impact the sort order that you see in pivots - on rows, on columns, in slicers, etc.

So it IS very much what you are looking for.  And I agree that it is basic functionality that should have been in version 1.


----------



## masplin (Apr 11, 2012)

Sorry i must being a bit slow. In my pivot data I have transaction month Januart 11 etc. I can sort that any way as the sort choice is oldest-newest. If I use that column in a pivot table I only get an A to Z sort. How can I get my row labels
April 12
March 12
etc?


----------



## powerpivotpro (Apr 11, 2012)

If you set up the following two columns in your PowerPivot window:

 <table style="width: 408px; height: 105px;" border="0" cellpadding="0" cellspacing="0"><colgroup><col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88">  <col style="mso-width-source:userset;mso-width-alt:4644;width:95pt" width="127">  </colgroup><tbody><tr style="height:15.0pt" height="20">   <td class="xl63" style="height:15.0pt;width:66pt" height="20" width="88">LabelColumn</td>   <td class="xl63" style="border-left:none;width:95pt" width="127">   HiddenSortColumn</td>  </tr>  <tr style="height:15.0pt" height="20">   <td class="xl64" style="height:15.0pt;border-top:none" height="20">April 12</td>   <td class="xl63" style="border-top:none;border-left:none" align="right">1</td>  </tr>  <tr style="height:15.0pt" height="20">   <td class="xl63" style="height:15.0pt;border-top:none" height="20">March 12</td>   <td class="xl63" style="border-top:none;border-left:none" align="right">2</td>  </tr>  <tr style="height:15.0pt" height="20">   <td class="xl63" style="height:15.0pt;border-top:none" height="20">Feb 12</td>   <td class="xl63" style="border-top:none;border-left:none" align="right">3</td>  </tr> </tbody></table>
Then sorted the LabelColumn by the HiddenSortColumn (using the feature that is new in PowerPivot V2/2012), that should be respected in your pivots.


----------



## masplin (Apr 11, 2012)

Is that in a seperate table?  Does that mean transaction date will always be descending in all pivots as of course sometimes you might want it ascending.


----------



## powerpivotpro (Apr 11, 2012)

I haven't had a chance to use the new feature much because Pivotstream's servers are still PowerPivot V1.

The "sort by" column is in the same table.  I don't know if it can be in another table.  But if you had to add another table and then use =RELATED() (or another formula) to "fetch" the sortby column into your existing table, I think you'd still be in good shape.

EDIT:  My workaround for ascending/descending was really dumb, I am deleting it while I noodle some more.

EDIT2:  OK, new suggested workaround for ascending/descending.  You introduce a second Label column that is IDENTICAL to the first column.  And introduce a second sortby column that is the REVERSE order of the first sortby column.  You then sort the new Label column by the new SortBy column, and when you want dates ascending in your pivot, you use the second Label column.  There may be a better way but without much experience with the feature this is the best I can come up with.


----------



## masplin (Apr 11, 2012)

haha I think as you wrote that you wondered why the brains at pivotpower didn't just allow data sorting as we are all used to!!! Seems manual is the way to go. Thanks for the hlep


----------



## masplin (Apr 10, 2012)

Powerpivot seems great for handling the data but the functionlity seems awful. I might give up with this, but hopefully I'm just being stupid. I have a column called "registration Date". Powerpivot has it as a date and I have formated it mmm-yy. So far so good.

If I create a pivot table using this field I have 2 problems
1. The date format is dd/mmm/yy. There is no function as in pivot to change the display of these units and selecting the cells and doing format cells makes no difference. I seem to be stuck with an unreadable date format.
2. Possible related, but when I go to sort it only has A to Z when I was expecting oldest to newest, as they are dates. If I sort it puts Mar11 next to Mar12.

My conconclusion is that for some reason it thinks these date fields are text so can't format them or sort them. Now becoming a useless tool quite quickly.

Thanks for any advice

Mike


----------



## powerpivotpro (Apr 11, 2012)

Honestly I still think you should use the sortby column feature rather than manual.  Manual sucks 

There is one other approach to try as well:  on the Pivot Options ribbon tab in Excel, click on Fields, Items, and Sets | Create Set Based on Row Items - this will let you create a set of dates that are manually sorted the way you want, and then re-use that set anywhere in the workbook.


----------

