diff --git a/core/modules/entity_reference/entity_reference.views.inc b/core/modules/entity_reference/entity_reference.views.inc
index 486fca1..75b9899 100644
--- a/core/modules/entity_reference/entity_reference.views.inc
+++ b/core/modules/entity_reference/entity_reference.views.inc
@@ -18,7 +18,7 @@ function entity_reference_field_views_data(FieldStorageConfigInterface $field_st
     // Add a relationship to the target entity type.
     $target_entity_type_id = $field_storage->getSetting('target_type');
     $target_entity_type = $entity_manager->getDefinition($target_entity_type_id);
-    $target_base_table = $target_entity_type->getBaseTable();
+    $target_base_table = $target_entity_type->getDataTable() ?: $target_entity_type->getBaseTable();
 
     // Provide a relationship for the entity type with the entity reference
     // field.
@@ -39,6 +39,8 @@ function entity_reference_field_views_data(FieldStorageConfigInterface $field_st
     // Provide a reverse relationship for the entity type that is referenced by
     // the field.
     $entity_type_id = $field_storage->getTargetEntityTypeId();
+    $entity_type = $entity_manager->getDefinition($entity_type_id);
+    $args['@label'] = $entity_type->getLabel();
     $pseudo_field_name = 'reverse__' . $entity_type_id . '__' . $field_storage->getName();
     /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
     $table_mapping = \Drupal::entityManager()->getStorage($entity_type_id)->getTableMapping();
@@ -49,9 +51,10 @@ function entity_reference_field_views_data(FieldStorageConfigInterface $field_st
       'field_name' => $field_storage->getName(),
       'field table' => $table_mapping->getDedicatedDataTableName($field_storage),
       'field field' => $field_storage->getName() . '_target_id',
-      'base' => $target_entity_type->getBaseTable(),
-      'base field' => $target_entity_type->getKey('id'),
+      'base' => $entity_type->getDataTable() ?: $entity_type->getBaseTable(),
+      'base field' => $entity_type->getKey('id'),
       'label' => t('@field_name', array('@field_name' => $field_storage->getName())),
+      'entity type' => $entity_type_id,
     );
   }
 
diff --git a/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php b/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php
index 9ae79a7..7de2cc1 100644
--- a/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php
+++ b/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php
@@ -151,4 +151,75 @@ public function testRelationship() {
     }
   }
 
+  /**
+   * Tests views data generated for relationship.
+   *
+   * @see entity_reference_field_views_data()
+   */
+  public function testRelationshipViewsData() {
+    // Create reference from entity_test_mul to entity_test.
+    FieldStorageConfig::create(array(
+      'entity_type' => 'entity_test_mul',
+      'field_name' => 'field_data_test',
+      'type' => 'entity_reference',
+      'settings' => array(
+        'target_type' => 'entity_test',
+      ),
+    ))->save();
+    FieldConfig::create(array(
+      'entity_type' => 'entity_test_mul',
+      'field_name' => 'field_data_test',
+      'bundle' => 'entity_test_mul',
+    ))->save();
+
+    // Check the generated views data.
+    $views_data = Views::viewsData()->get('entity_test_mul__field_data_test');
+    $this->assertEqual($views_data['field_data_test']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data['field_data_test']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data['field_data_test']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data['field_data_test']['relationship']['relationship field'], 'field_data_test_target_id');
+    $this->assertEqual($views_data['field_data_test']['relationship']['entity type'], 'entity_test');
+
+    // Check the backwards reference.
+    $views_data = Views::viewsData()->get('entity_test');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['id'], 'entity_reverse');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['field table'], 'entity_test_mul__field_data_test');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['field field'], 'field_data_test_target_id');
+    $this->assertEqual($views_data['reverse__entity_test_mul__field_data_test']['relationship']['entity type'], 'entity_test_mul');
+
+    // Create reference from entity_test to entity_test_mul.
+    FieldStorageConfig::create(array(
+      'entity_type' => 'entity_test',
+      'field_name' => 'field_test_data',
+      'type' => 'entity_reference',
+      'settings' => array(
+        'target_type' => 'entity_test_mul',
+      ),
+    ))->save();
+    FieldConfig::create(array(
+      'entity_type' => 'entity_test',
+      'field_name' => 'field_test_data',
+      'bundle' => 'entity_test',
+    ))->save();
+
+    // Check the generated views data.
+    $views_data = Views::viewsData()->get('entity_test__field_test_data');
+    $this->assertEqual($views_data['field_test_data']['relationship']['id'], 'standard');
+    $this->assertEqual($views_data['field_test_data']['relationship']['base'], 'entity_test_mul_property_data');
+    $this->assertEqual($views_data['field_test_data']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data['field_test_data']['relationship']['relationship field'], 'field_test_data_target_id');
+    $this->assertEqual($views_data['field_test_data']['relationship']['entity type'], 'entity_test_mul');
+
+    // Check the backwards reference.
+    $views_data = Views::viewsData()->get('entity_test_mul_property_data');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['id'], 'entity_reverse');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['base'], 'entity_test');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['base field'], 'id');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['field table'], 'entity_test__field_test_data');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['field field'], 'field_test_data_target_id');
+    $this->assertEqual($views_data['reverse__entity_test__field_test_data']['relationship']['entity type'], 'entity_test');
+  }
+
 }
diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc
index 3160ea1..447766f 100644
--- a/core/modules/taxonomy/taxonomy.views.inc
+++ b/core/modules/taxonomy/taxonomy.views.inc
@@ -74,7 +74,7 @@ function taxonomy_field_views_data(FieldStorageConfigInterface $field_storage) {
     $field_name = $field_storage->getName();
     $data[$table_name][$field_name . '_target_id']['relationship'] = array(
       'id' => 'standard',
-      'base' => 'taxonomy_term_data',
+      'base' => 'taxonomy_term_field_data',
       'base field' => 'tid',
       'label' => t('term from !field_name', array('!field_name' => $field_name)),
     );
@@ -100,7 +100,7 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldStorageCo
 
   list($label) = views_entity_field_label($entity_type_id, $field_name);
 
-  $data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array(
+  $data['taxonomy_term_field_data'][$pseudo_field_name]['relationship'] = array(
     'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
     'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity_type->getLabel(), '@field' => $label)),
     'id' => 'entity_reverse',
@@ -108,7 +108,7 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldStorageCo
     'entity_type' => $entity_type_id,
     'field table' => $table_mapping->getDedicatedDataTableName($field_storage),
     'field field' => $field_name . '_target_id',
-    'base' => $entity_type->getBaseTable(),
+    'base' => $entity_type->getDataTable() ?: $entity_type->getBaseTable(),
     'base field' => $entity_type->getKey('id'),
     'label' => t('!field_name', array('!field_name' => $field_name)),
     'join_extra' => array(
