Forum Discussion

Mile_josh's avatar
Mile_josh
New Member
3 years ago
Solved

Add new column from existing table in new generated table (distinct and union)

I have multiple tables eg:

Table1    
UrlTitleTemp URL
https://example.com/Page Onehttps://example.com/page1
https://example.com/page2Page Two 
https://example.com/page5Page Fivehttps://example.com/pagefive

 

Table2 
UrlTitle
https://example.com/page3Page Three
https://example.com/ 

 

Table3 
UrlTitle
https://example.com/page3Page Three
https://example.com/page4Page Four

 

 

I want to generate a new table with a union with all tables and the value (URL) should be distinct. For all Table1 URLs, I also want Temp Url to be added to this newly generated table

Generated Table  
UrlTitleTemp url
https://example.com/Page Onehttps://example.com/page1
https://example.com/page2Page Two 
https://example.com/page5Page Fivehttps://example.com/pagefive
https://example.com/page3Page Three 
https://example.com/page4Page Four 

 

Ashish_Mathur , Arul 

4 Replies

  • Hi,

    In the Query Editor, append the three tables and then Remove Duplicates.

  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    Mile_josh ,

    I have generated some sample data for your requirement and written the formula to polpulate the third table. Please refer them,
    Table 1:

    Table 2:

    Table 3 (Populated usnig dax formula):

    Table3 = 
    UNION ( DISTINCT ( T1[Url] ), DISTINCT ( T1[Temp url] ), DISTINCT ( T2[Url] ) )

    Thanks,

    Arul

    • Mile_josh's avatar
      Mile_josh
      New Member

      Hi Arul 

      For each Url in Table 1 , I want tempUrl in same row. The new generated table should have Column Url, Title, Tempurl. tempurl value for other tables would empty.

       

  • Hi,

    Share some data to work with and show the expected result clearly.