Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
idssohamjondhal
New Member

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.

idssohamjondhal_0-1667825891157.png

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.

idssohamjondhal_1-1667826042969.png

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community 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:-

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community 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:-

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.