Forum Discussion

suparnababu8's avatar
suparnababu8
Super User
3 years ago
Solved

Appending 2 Tables By using DAX

Hi All..!!

 

I have two tables like 

 

Table A like below

and 

Table B like below

 

 

and

 

i will get Result Table as follows

 

 

 

Any one pls help inthis regard.

 

Thanks in Advance...
Incom Anonymous 

  • Hello suparnababu8 

    use the below Dax to create the table.


    ResultTable =
    SUMMARIZE (
    UNION (
    SELECTCOLUMNS ( 't1', "Month", 't1'[Month] ),
    SELECTCOLUMNS ( 't2', "Month", 't2'[Month] )
    ),
    [Month],
    "Amt",
    LOOKUPVALUE ( T2[Sales], T2[Month], [Month] )
    + LOOKUPVALUE ( T1[Sales], T1[Month], [Month] )
    )

     

    Let me know if this helps!

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!







2 Replies

  • NaveenGandhi's avatar
    NaveenGandhi
    Memorable Member

    Hello suparnababu8 

    use the below Dax to create the table.


    ResultTable =
    SUMMARIZE (
    UNION (
    SELECTCOLUMNS ( 't1', "Month", 't1'[Month] ),
    SELECTCOLUMNS ( 't2', "Month", 't2'[Month] )
    ),
    [Month],
    "Amt",
    LOOKUPVALUE ( T2[Sales], T2[Month], [Month] )
    + LOOKUPVALUE ( T1[Sales], T1[Month], [Month] )
    )

     

    Let me know if this helps!

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!







  • Syk's avatar
    Syk
    Resident Rockstar

    You can do this in power query quite easily.