I have two tables.
1) Table 1 : 1 column with date value
2) Table 2 : 2 columns : Date column + business value column
I am trying to use DAX in PowerBI to create a new table using a left outer join to fill missing dates in my second table.
First table :
| Date |
| 2015-05-01 |
| 2015-06-01 |
| 2015-07-01 |
| 2015-08-01 |
Second table :
| Date | Value |
| -----------|--------- |
| 2015-05-01 | 5 |
| 2015-05-01 | 5 |
| 2015-06-01 | 6 |
| 2015-07-01 | 7 |
DAX code to create new table :
Table =
var table4=
SELECTCOLUMNS(Table1, "Date", Table1[Date]&"")
var table5=
SELECTCOLUMNS(Table2,"value", Table2[value],"Date", Table2[Date]&"")
return
NATURALLEFTOUTERJOIN(table4,table5)
This is returning :
| Date | Value |
| -----------|--------- |
| 2015-05-01 | 5 |
| 2015-06-01 | 6 |
| 2015-07-01 | 7 |
| 2015-08-01 | NA|
But I want:
| Date | Value |
| -----------|--------- |
| 2015-05-01 | 5 |
| 2015-05-01 | 5 |
| 2015-06-01 | 6 |
| 2015-07-01 | 7 |
| 2015-08-01 | NA |
I am not sure why it is removing the second value of
| 2015-05-01 5|
I need the two values for the month of may to remain in the table. Any ideas ? thanks a lot