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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
_Xandyr_
Helper II
Helper II

Combine two different tables

Hello,

 

I have a problem I haven't been able to figure out. I have two files that I would like to combine in order to show my data better in my report. The two input files I have are File 1 and 2, and what I would like to do is Table 3. However I can't seem to create any relationship between Report day so wonder how I can get this to work smoothly? 

 

Thank you!

 Capture.JPG

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @_Xandyr_ 

 

Sure, you can just create a date dimension join both tables on Report Day

https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns

Later create Two Measures and add them to the table.

Trucks = 
CALCULATE(
    SUM( 'Table 4'[Qty] ),
    'Table 4'[Filter X] = 460, 
    'Table 4'[Yes / no] = "Yes",
    'Table 4'[Current / Non Current / N/A] = "N/A"
)
Car = 
CALCULATE(
    SUM( 'Table 5'[Qty] ),
    'Table 5'[Type 1] = 110, 
    'Table 5'[Type 2] = "YY"
)

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

5 REPLIES 5
_Xandyr_
Helper II
Helper II

Hello both @Mariusz  & @amitchandak , thank you for the fast replies!

 

I realized my two tables were more "complex" than I showed here. If my lists/tables looks like this instead, how can I merge these two in the best way?

Thank you!

Capture.JPG

Mariusz
Community Champion
Community Champion

Hi @_Xandyr_ 

 

Sure, you can just create a date dimension join both tables on Report Day

https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns

Later create Two Measures and add them to the table.

Trucks = 
CALCULATE(
    SUM( 'Table 4'[Qty] ),
    'Table 4'[Filter X] = 460, 
    'Table 4'[Yes / no] = "Yes",
    'Table 4'[Current / Non Current / N/A] = "N/A"
)
Car = 
CALCULATE(
    SUM( 'Table 5'[Qty] ),
    'Table 5'[Type 1] = 110, 
    'Table 5'[Type 2] = "YY"
)

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi again @Mariusz,

 

This worked like a charm, thank you very much!

amitchandak
Super User
Super User

Try like

table =
var _tab=
union(
summarize(table1, table1[Report Date], "car",0,"truck",sum(table[Qty])),
summarize(table2, table2[Report Date], "car",sum(table[deilvery]),"truck",0)
)
return
summarize(_tab,[Report Date],"Car",sum([car]),"truck",sum([truck]),"total",sum([car])+sum([truck]))
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Mariusz
Community Champion
Community Champion

Hi @_Xandyr_ 

 

You can do it in Power Query,

  • Reference your table 2 
  • Use Group By on Report Date and Type Of and Sum On Qty
  • And later use merge queries on both tables 1 and 2

If you would like me to create a sample file then please provide both tables in a usable format.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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