Forum Discussion

idssohamjondhal's avatar
idssohamjondhal
New Member
3 years ago
Solved

Merge two tables with a Date Condition.

Hello Everyone !! I have two tables one is Actual Table which has a Date Column , Product Column and Qty Column. Second Table is my Target table which has Month column & Target column and I have Target only on the First Date of the month. So I joined both the tables on the basis of Date Column.

Now what happens is, Whenever I select Pivot Table in Power Bi desktop, and when I Drag Date Column, Product column, Qty column, and Target column. Its showing me Target value, product value as well as 1st Date Qty value but when I select 2nd Date the Pivot Table becomes Blank. So What I want is My Target should remain same for the whole month of June. But When I select different dates it should show me respective dates Qty value, product value and it can show me the Total Sum for Target Column.

 

  • Hi idssohamjondhal ,

     

    Create the custom column as below in the both table and join the tables with this column

    MonthYear = MONTH('Actual Table'[Date])&"-"&YEAR('Actual Table'[Date])
    MonthYear = MONTH(Target[Month])&"-"&YEAR(Target[Month])

     

    Refer a file below:-

     

     

1 Reply

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi idssohamjondhal ,

     

    Create the custom column as below in the both table and join the tables with this column

    MonthYear = MONTH('Actual Table'[Date])&"-"&YEAR('Actual Table'[Date])
    MonthYear = MONTH(Target[Month])&"-"&YEAR(Target[Month])

     

    Refer a file below:-