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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
mejiaks
Frequent Visitor

joining tables

Hi guys

 

I have two tables

 

Kms and Incidents

 

in both tables i have the fileds

Country, Division, Month, Year

 

The only difference is the last field

Kms.[Total Kms]

Incidents.[Total Incidents]

 

what I need is to have a third table with common fields and [Total Kms] From Kms Table and [Total Incidents] From Incidents table. 

 

something like this

 

Kms Table

Country, Division, Month, Year, Total Kms

GT          CLS            1        2018    100

GT          CLI             1        2018     200

HN         CLS            1        2018      10

 

Incidents Table

Country, Division, Month, Year, Total Kms

GT          CLS            1        2018    1

GT          CLI             1        2018    2

HN         CLS            1        2018    0

 

and have this result

 

Kms And Incidents

Country, Division, Month, Year, Total Kms   Total Incidents

GT          CLS            1        2018    100                 1 

GT          CLI             1        2018     200                2 

HN         CLS            1        2018      10                  0

 

is this possible?

 

TIA

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @mejiaks,

 

You could create a calculated table with below DAX formula:

Join Table =
ADDCOLUMNS (
    Kms,
    "Total Incidents", LOOKUPVALUE (
        Incidents[Total Kms],
        Incidents[Country], Kms[Country],
        Incidents[Division], Kms[Division],
        Incidents[Month], Kms[Month],
        Incidents[Year], Kms[Year]
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @mejiaks,

 

You could create a calculated table with below DAX formula:

Join Table =
ADDCOLUMNS (
    Kms,
    "Total Incidents", LOOKUPVALUE (
        Incidents[Total Kms],
        Incidents[Country], Kms[Country],
        Incidents[Division], Kms[Division],
        Incidents[Month], Kms[Month],
        Incidents[Year], Kms[Year]
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That is EXACTLY what I needed and EXACTLY what I was looking for

 

simple, straight forward and fast

 

Thanks a lot

 

affan
Solution Sage
Solution Sage

Hi @mejiaks,

 

As you have shown the tables in your post, there is no unique Key field based on which we can join the tables. This means that we need to provide a field on which PBI can identify that which value from Incidents value should be matched with which row in the Kms table.

 

To resolve this we need to create this field. I have made the below video which will help you to resolve this issue.

 

                                                   

  

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors