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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

UNION DISTINCT question

hi all,

 

i found following way to combine two distinct tables and use UNION like in SQL (without double entries):

 

TABLE_X =

UNION (
SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]),
SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C])
)
 
TABLE_Y =
SUMMARIZE(Table_X, Table_X[A], Table_X[B], Table_X[C])
 
Is it possible to write that in one measure? a better dax formular is also welcome 🙂
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Pikachu-Power ,

You can write this DAX:

TABLE =
Var _X= UNION (
SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]),
SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C])
)
Return 
SUMMARIZE(_X,[A], [B], [C])

 

Best Regards,

Liu Yang

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

3 REPLIES 3
Anonymous
Not applicable

Hi  @Pikachu-Power ,

You can write this DAX:

TABLE =
Var _X= UNION (
SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]),
SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C])
)
Return 
SUMMARIZE(_X,[A], [B], [C])

 

Best Regards,

Liu Yang

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

mahoneypat
Microsoft Employee
Microsoft Employee

You can try this expression

 

NewTable =

var TableX = UNION (
SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]),
SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C])
)
 
Return
SUMMARIZE(TableX, Table1[A], Table1[B], Table1[C])
 
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


Thanks. Seems to work. But shouldnt we use somethink like:
 
...
Return
SUMMARIZE(TableX, TableX[A], TableX[B], TableX[C])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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