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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
vidya9924
Frequent Visitor

what is the best way to relate these 2 tables ?

Table 1 : 

vidya9924_2-1708926465601.png

 and Table 2:

vidya9924_3-1708926485936.png

I want to combine both like this 

vidya9924_4-1708926684806.png

how to establish relationship between the 2 tables to achieve this ?

5 REPLIES 5
CupidC
Helper II
Helper II

CupidC_0-1709013665568.png

 

Table =
    VAR Table1 =    GENERATE('Table 1',FILTER('Table 2','Table 2'[kactid]='Table 1'[kactid1]))
    VAR Result =
    SELECTCOLUMNS(Table1,
        "Event ID",[kactid],
        "Attending Worker", [AttendingWorker],
        "Service Unit", [itemname],
        "Kinvlineid",[kactlineid])
    RETURN
    Result
PijushRoy
Super User
Super User

Hi @vidya9924 

Please share sample data in excel format for both table

@PijushRoy Table 1 Sample : 

kbookitemidkactidsloginslogmodAttendingWorker
6241111/05/2019 20:5111/05/2019 20:51Titheridge Karen - 1129
6255524/07/2019 16:0324/07/2019 16:15Chan Crystal - 1142
25642524/07/2019 16:1524/07/2019 16:16 
6255724/07/2019 16:1824/07/2019 16:18Chan Crystal - 1142
62551330/07/2019 10:5330/07/2019 10:53Chan Crystal - 1142
62551630/07/2019 13:1330/07/2019 13:13Chan Crystal - 1142
62311630/07/2019 13:1330/07/2019 13:13Perris Kane - 1120
61912730/07/2019 14:1030/07/2019 14:10Kanu Jemila - 1080
255172730/07/2019 14:1019/09/2019 16:36 
4039781969825/02/2024 11:5625/02/2024 11:56 
4623181969825/02/2024 11:5625/02/2024 11:56Levacic Karlo - 1453
4215181969825/02/2024 11:5625/02/2024 11:56Palmer Tyne - 1388
3946681969825/02/2024 11:5625/02/2024 11:56Humbler Dion - 1321

 

Table 2 Sample :

kactlineidkitemiditemnamelineqtylinefeelinetotalkactid
2861276Individual Therapy - Face to Face1.5193.99290.9927
71218826GD Service - Non Face to Face0.7500819698
71218723GD Service - Face to Face0.7500819698
71218927GD Service - Reports/Notes0.1700819698

Hi @vidya9924 ,

Depending on the information you provided, you can refer to the following steps:

1.Merge in Power Query.

vyifanwmsft_2-1709011994666.png

vyifanwmsft_0-1709011785116.png

2.Expand the table.

vyifanwmsft_1-1709011921840.png

Final output:

vyifanwmsft_3-1709012222775.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey, its a very huge table with more than 2 million rows of data so merging consumes a lot of time. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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