Pandas pivot_table MultiIndex and dropna=False generates all combinations of modalities instead of keeping existing one only
#### Minimal Verifiable Working Example

Bellow you will find a Minimal Verifiable Working Example that reproduces the behaviour I am considering in this issue:

```python
import pandas as pd
# JSON Dump for MWVE:
txt = """[{"channelid":5069,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Cu","timestamp":1514764800000,"userfloatvalue":null},{"channelid":5069,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Cu","timestamp":1514851200000,"userfloatvalue":null},{"channelid":5069,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Cu","timestamp":1514937600000,"userfloatvalue":null},{"channelid":5069,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Cu","timestamp":1515024000000,"userfloatvalue":null},{"channelid":5119,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Cu","timestamp":1514764800000,"userfloatvalue":null},{"channelid":5119,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Cu","timestamp":1514851200000,"userfloatvalue":null},{"channelid":5119,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Cu","timestamp":1514937600000,"userfloatvalue":null},{"channelid":5119,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Cu","timestamp":1515024000000,"userfloatvalue":null},{"channelid":5120,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Pb","timestamp":1514764800000,"userfloatvalue":null},{"channelid":5120,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Pb","timestamp":1514851200000,"userfloatvalue":null},{"channelid":5120,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Pb","timestamp":1514937600000,"userfloatvalue":null},{"channelid":5120,"networkkey":"HMT","sitekey":"01MEU1","measurandkey":"Pb","timestamp":1515024000000,"userfloatvalue":null},{"channelid":5233,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Pb","timestamp":1514764800000,"userfloatvalue":null},{"channelid":5233,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Pb","timestamp":1514851200000,"userfloatvalue":null},{"channelid":5233,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Pb","timestamp":1514937600000,"userfloatvalue":null},{"channelid":5233,"networkkey":"HMT","sitekey":"01AND3","measurandkey":"Pb","timestamp":1515024000000,"userfloatvalue":null}]"""
# Load Data:
df = pd.read_json(txt)
# Filling NaN with string works as expected but downcast column types:
cross2 = df.pivot_table(index="timestamp", columns=["channelid", "networkkey", "sitekey", "measurandkey"], values="userfloatvalue", aggfunc="first", fill_value="nodata")
# Trying to pivot data using MultiIndex and keeping columns of NaN produces all combinations of modalities:
cross3 = df.pivot_table(index="timestamp", columns=["channelid", "networkkey", "sitekey", "measurandkey"], values="userfloatvalue", aggfunc="first", dropna=False)
```

Trial input looks like (`df`):

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>channelid</th>
      <th>measurandkey</th>
      <th>networkkey</th>
      <th>sitekey</th>
      <th>timestamp</th>
      <th>userfloatvalue</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>5069</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-01</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>1</th>
      <td>5069</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-02</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2</th>
      <td>5069</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-03</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>3</th>
      <td>5069</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-04</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>4</th>
      <td>5119</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-01</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5119</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-02</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>6</th>
      <td>5119</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-03</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>7</th>
      <td>5119</td>
      <td>Cu</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-04</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>8</th>
      <td>5120</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-01</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>9</th>
      <td>5120</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-02</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>10</th>
      <td>5120</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-03</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>11</th>
      <td>5120</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01MEU1</td>
      <td>2018-01-04</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>12</th>
      <td>5233</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-01</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>13</th>
      <td>5233</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-02</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>14</th>
      <td>5233</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-03</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>15</th>
      <td>5233</td>
      <td>Pb</td>
      <td>HMT</td>
      <td>01AND3</td>
      <td>2018-01-04</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>

Misbehaved output looks like (`cross3`):

<table border="1" class="dataframe">
  <thead>
    <tr>
      <th>channelid</th>
      <th colspan="4" halign="left">5069</th>
      <th colspan="4" halign="left">5119</th>
      <th colspan="4" halign="left">5120</th>
      <th colspan="4" halign="left">5233</th>
    </tr>
    <tr>
      <th>networkkey</th>
      <th colspan="4" halign="left">HMT</th>
      <th colspan="4" halign="left">HMT</th>
      <th colspan="4" halign="left">HMT</th>
      <th colspan="4" halign="left">HMT</th>
    </tr>
    <tr>
      <th>sitekey</th>
      <th colspan="2" halign="left">01AND3</th>
      <th colspan="2" halign="left">01MEU1</th>
      <th colspan="2" halign="left">01AND3</th>
      <th colspan="2" halign="left">01MEU1</th>
      <th colspan="2" halign="left">01AND3</th>
      <th colspan="2" halign="left">01MEU1</th>
      <th colspan="2" halign="left">01AND3</th>
      <th colspan="2" halign="left">01MEU1</th>
    </tr>
    <tr>
      <th>measurandkey</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Cu</th>
      <th>Pb</th>
    </tr>
    <tr>
      <th>timestamp</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>2018-01-01</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-02</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-03</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-04</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>

Expected output is similar to `cross2` but with `NaN` value instead of string and looks like:

<table border="1" class="dataframe">
  <thead>
    <tr>
      <th>channelid</th>
      <th>5069</th>
      <th>5119</th>
      <th>5120</th>
      <th>5233</th>
    </tr>
    <tr>
      <th>networkkey</th>
      <th>HMT</th>
      <th>HMT</th>
      <th>HMT</th>
      <th>HMT</th>
    </tr>
    <tr>
      <th>sitekey</th>
      <th>01MEU1</th>
      <th>01AND3</th>
      <th>01MEU1</th>
      <th>01AND3</th>
    </tr>
    <tr>
      <th>measurandkey</th>
      <th>Cu</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Pb</th>
    </tr>
    <tr>
      <th>timestamp</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>2018-01-01</th>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
    </tr>
    <tr>
      <th>2018-01-02</th>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
    </tr>
    <tr>
      <th>2018-01-03</th>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
    </tr>
    <tr>
      <th>2018-01-04</th>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
      <td>nodata</td>
    </tr>
  </tbody>
</table>

#### Problem description

I have the need:

 - to use MultiIndex in columns even if it is overdetermined (I mean, with less levels, index is still unique) and;
 - to keep columns full of NaN because it means the channel lacks all its data.

What seems to be the problem, is the creation of all combination of level modalities (instead of keep the existing one only) which drastically increases the amount of Memory without necessity (those combinations are not present in original data).

Maybe it is a bug, maybe it is the designed behaviour. Just wanted to notice it because it has surprised me, and now I am looking to a clean way to circonvolve this behaviour.

How have I found it:

I first had a `Memory Error` with small queries (about 1000 rows and 25 channels), then I reduced the amount of rows and columns, and I finally dumped it to JSON in order to get the following MVWE above.

#### Expected Output

To my understanding, the following command:

```python
cross3 = df.pivot_table(index="timestamp", columns=["channelid", "networkkey", "sitekey", "measurandkey"], values="userfloatvalue", aggfunc="first", dropna=False)
```

Should return the same as:
```python
cross2 = df.pivot_table(index="timestamp", columns=["channelid", "networkkey", "sitekey", "measurandkey"], values="userfloatvalue", aggfunc="first", fill_value="nodata")
cross2bis = cross2.replace('nodata', float('nan'))
```

A small DataFrame with no extra columns and NaN value not dropped, it should look like:

<table border="1" class="dataframe">
  <thead>
    <tr>
      <th>channelid</th>
      <th>5069</th>
      <th>5119</th>
      <th>5120</th>
      <th>5233</th>
    </tr>
    <tr>
      <th>networkkey</th>
      <th>HMT</th>
      <th>HMT</th>
      <th>HMT</th>
      <th>HMT</th>
    </tr>
    <tr>
      <th>sitekey</th>
      <th>01MEU1</th>
      <th>01AND3</th>
      <th>01MEU1</th>
      <th>01AND3</th>
    </tr>
    <tr>
      <th>measurandkey</th>
      <th>Cu</th>
      <th>Cu</th>
      <th>Pb</th>
      <th>Pb</th>
    </tr>
    <tr>
      <th>timestamp</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>2018-01-01</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-02</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-03</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>2018-01-04</th>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>

Without generating combination of level modalities that does not exists in input data.
This will also prevent raising a `MemoryError` for reasonable amount of data.

#### Output of ``pd.show_versions()``

<details>

```
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-75-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.20.3
pytest: None
pip: 9.0.1
setuptools: 36.4.0
Cython: None
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 5.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: 1.1.9
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
s3fs: None
pandas_gbq: None
pandas_datareader: None
```

</details>