Forum Discussion

KRAYA's avatar
KRAYA
New Member
1 year ago
Solved

How to create table with many table

Dear All,
I have many 4 table 
Table 1: 

Status Link
PendingLink 1
Due soonLink1
PendingLink 2
PendingLink 3


Table 2: 

Status Link
PendingLink 10
Due soonLink 5
Due soonLink 6
Due soonLink 7


Table 3:

Status Link
PendingLink 11
Due soonLink 12
Due soonLink 13
Due soonLink 14
Due soonLink 15
PendingLink 16


Table 4

Status Link
CorrectLink 11
IncorrectLink 12
CorrectLink 13
IncorrectLink 16



I need to club this all 4 table and make new table (Table 5) into power BI 
Table 5

CategoryStatus Link to visit
Table 1Status Link
Table 1PendingLink 1
Table 1Due soonLink1
Table 1PendingLink 2
Table 1PendingLink 3
Table 2PendingLink 10
Table 2Due soonLink 5
Table 2Due soonLink 6
Table 2Due soonLink 7
Table 3PendingLink 11
Table 3Due soonLink 12
Table 3Due soonLink 13
Table 3Due soonLink 14
Table 3Due soonLink 15
Table 3PendingLink 16
Table 4CorrectLink 11
Table 4IncorrectLink 12
Table 4CorrectLink 13
Table 4IncorrectLink 16


I tried doing Function - Selectcolumn and Union but failed to get this .Can any one explain me how to do this 

  • KRAYA 

    Create the new table

    Table5 = 
    UNION(
    SELECTCOLUMNS(
    Table1,
    "Category", "Table 1",
    "Status", Table1[Status],
    "Link to visit", Table1[Link]
    ),
    SELECTCOLUMNS(
    Table2,
    "Category", "Table 2",
    "Status", Table2[Status],
    "Link to visit", Table2[Link]
    ),
    SELECTCOLUMNS(
    Table3,
    "Category", "Table 3",
    "Status", Table3[Status],
    "Link to visit", Table3[Link]
    ),
    SELECTCOLUMNS(
    Table4,
    "Category", "Table 4",
    "Status", Table4[Status],
    "Link to visit", Table4[Link]
    )
    )

    Give this a try and let me know if it works for you!

     

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn

2 Replies

  • KRAYA 

    Create the new table

    Table5 = 
    UNION(
    SELECTCOLUMNS(
    Table1,
    "Category", "Table 1",
    "Status", Table1[Status],
    "Link to visit", Table1[Link]
    ),
    SELECTCOLUMNS(
    Table2,
    "Category", "Table 2",
    "Status", Table2[Status],
    "Link to visit", Table2[Link]
    ),
    SELECTCOLUMNS(
    Table3,
    "Category", "Table 3",
    "Status", Table3[Status],
    "Link to visit", Table3[Link]
    ),
    SELECTCOLUMNS(
    Table4,
    "Category", "Table 4",
    "Status", Table4[Status],
    "Link to visit", Table4[Link]
    )
    )

    Give this a try and let me know if it works for you!

     

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn

  • Hello KRAYA ,

     

    Here is a simple dax for you :

     

    Table5 =
    UNION(
    ADDCOLUMNS(Table1, "Category", "table1"),
    ADDCOLUMNS(Table2, "Category", "table2"),
    ADDCOLUMNS(Table3, "Category", "table3"),
    ADDCOLUMNS(Table4, "Category", "table4")
    )

     

    I hope this helps.

     

    Did I answer your query ? Mark this as solution if this helps or give a thumbs up.

     

    Cheers