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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ChoiJunghoon
Helper III
Helper III

[DAX] How to append Table A/B

Untitled.png

I want to create "NewTable". 

I am able to use only DAX code. 

 

Could you help me.... 

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @ChoiJunghoon ,

 

You may create calculated table like DAX below.

 

Table3 =

var _Table= EXCEPT(VALUES(Table2[Date]),VALUES(Table1[Date]))

return

UNION(SUMMARIZE(Table1,Table1[Date],"Value", SUM(Table1[Value])),

SUMMARIZE(_Table, [Date],"Value", SUM(Table2[Value])) )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

7 REPLIES 7
v-xicai
Community Support
Community Support

Hi @ChoiJunghoon ,

 

You may create calculated table like DAX below.

 

Table3 =

var _Table= EXCEPT(VALUES(Table2[Date]),VALUES(Table1[Date]))

return

UNION(SUMMARIZE(Table1,Table1[Date],"Value", SUM(Table1[Value])),

SUMMARIZE(_Table, [Date],"Value", SUM(Table2[Value])) )

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, append the two tables.  To your visual, drag the Date column from the appended dataset and write this measure

=SUM(Data[Value])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sorry, I have to use only DAX function. 

Because, I use the Direct Query. 
and I've already done this report. 

mahoneypat
Microsoft Employee
Microsoft Employee

Please try this expression for your table

 

New Table =
VAR __Table2 =
    SELECTCOLUMNS ( Table2, "Date", Table2[Date], "Value", Table2[Value] )
VAR __Table1 =
    SELECTCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE ( Table1, Table1[Date] ),
            "@Value", CALCULATE ( SUM ( Table1[Amount] ) )
        ),
        "Date", [Date],
        "Value", [@Value]
    )
RETURN
    UNION ( __Table2, __Table1 )

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you for your answer. 

But your answer is gap with what i want. 

A0
B0
C0
D0
A15
B15
D13

 

I want to remove duplication data..

I want to create "New Table" 

A15
B15
C0
D13

My bad.  Forgot that part.  Please try this one.  I didn't put your data into a model so can't confirm myself.

 

 

New Table =
VAR __Table2 =
    SELECTCOLUMNS ( Table2, "Date", Table2[Date], "Value", Table2[Value] )
VAR __Table1 =
    SELECTCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE ( Table1, Table1[Date] ),
            "@Value", CALCULATE ( SUM ( Table1[Amount] ) )
        ),
        "Date", [Date],
        "Value", [@Value]
    )
VAR __unioned =
    UNION ( __Table2, __Table1 )
RETURN
    SUMMARIZE ( __unioned, [Date], "Value", SUM ( [Value] ) )

 

  

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


NewTable =
Var _Table2 =
SELECTCOLUMNS(Table2,"Date",Table2[Date],"Value",Table2[Value])
Var _Table1 =
SELECTCOLUMNS(
ADDCOLUMNS(SUMMARIZE(Table1,Table1[Date]),
"@Value",CALCULATE(SUM(Table1[Value]))
),"Date",[Date]
,"Value",[@Value])

Var _unioned=UNION(_Table2,_Table1)
RETURN
SUMMARIZE(_unioned,[Date],"Value",SUM([Value]))


sum[Value] is error " Cannot Identify the table that contains [Value] Column."

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors