If you are performing Data blending, this would be an issue. Can you check if you have latest version to perform cross Joins if the data is residing in two different forms. With cross join you can create one data source and this will solve the problem.
Tableau data blends are *after* aggregation and so a secondary source that has a finer grain (like your D2 source) cannot increase the grain of the resulting view. See TDT: Data Blending - Left Join or not? - presented March 26, 2015 for lots more details on data blending. There are several options here:
1) Sometimes you can "flip the blend" by creating a new worksheet where the D2 is the primary and D1 is the secondary.
2) Use the new cross data source joins feature introduced in v10.0.
3) Create a new "scaffold" data source that has the grain that you need to be the primary source and then both D1 and D2 are secondary sources.
4) Do the work to create a joined source outside of Tableau, for example by using linked databases/linked servers, an ETL tool such as Alteryx/SSIS/Informatica, etc.
Thanks jonathan and Rekha,the problem is that i have tableau 9.0 software and cross join feature is not present in it. Even ,i thought of applying cross join through new sql query feature but this feature is not showing up in Tabeau 9.0 Version.