PowerPivot Changing Data Type

cmcreynolds

Active Member
Joined
May 21, 2015
Messages
295
Hello -

Built a table on a worksheet and added it to the Data Model but every time I hit "Refresh All" Power Pivot changes my date column to text, which causes an error with my lookups to my calendar table.

I think one solution is to run that table through PowerQuery, first, but is that really necessary?

Is this because there are blanks and nulls in my table? (I'm creating a budget and haven't put in all dates, yet)

I can change the type todate in PP, but when I refresh, it goes back to "text".

Kinda frustrating.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I have never heard of this before. I agree with your assumption that it is probably related to the blanks in the data set. I would therefore assume that power query can solve the problem. You can simply change the data type in power query, and my assumption is that power query will handle the spaces and nulls prior to load
 
Upvote 0
Odd, this sounds similar to an old SSAS Tabular bug. I don't think I've ever seen it in Power Pivot... If your data is a SQL query, try sorting it so dates (and not blanks) appear first.

Basically, when the engine is sampling the data (in SSAS Tabular, at least) it uses the first few thousand rows to determine the data type. Sometimes it's very stubborn about what a field should be and it won't let you easily change it to the correct type.

** EDIT, I should add that re-sorting the data sometimes won't fix the model. Yes, it's THAT stubborn. But in SSAS Tabular it will prevent it from screwing up again if you make the model from scratch.
 
Last edited:
Upvote 0
Always go through PQ if given the option. It shouldn't cost file size.

Although, on that note, I would suggest sorting your PQ query on whichever column has the highest cardinality as this may increase compression if your data is millions of records long.
 
Upvote 0
Okay, here's a question that might warrant a separate thread: So, I sent it to the DataModel, then built a pivot table and added conditional formatting and whatnot. If I decide I have to go through PQ, do I have to rebuild my pivot table and formatting, or is there a "sneaky" way of getting the new table into what I had formatted? (I know, I'm being lazy)
 
Upvote 0
If I decide I have to go through PQ, do I have to rebuild my pivot table and formatting?

Unfortunately once you change the data source type, you can't change unless you remove the table and add it again. Here are my tips and suggestions.
1. create a temp table and move all the measures into that table. THis will keep the formatting etc
2. you can try to turn off pivot table refresh if you like (Excel 2013). This MAY POSSIBLY stop the pivot updating until after the maintenance. It is worth a try. Install the addin, right click on any pivot and disable auto refresh. Do the maintenance and then turn it back on the same way. https://olappivottableextend.codeplex.com/wikipage?title=Excel 2013
3. remove the table, add the replacement table, rejoin the tables
4. move the measures back
5. turn on refresh if you turned it off.
 
Upvote 0

Forum statistics

Threads
1,224,152
Messages
6,176,724
Members
452,740
Latest member
MrCY

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