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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

I need to union 3 columns and get their sum based on the unification ,then visualise it

I have 3 tables , I want to union 3 columns from them
Table:User COlumn: "Name",
table :CustomerOrders, "CustomerName"
Table: Merchandise,"Name"


I am trying this formula but it is giving me some errors
var customers= UNION(DISTINCT('User'[Name]),DISTINCT(CustomerOrders[CustomerName]))
var selected= UNION(SELECTCOLUMNS('User',"EU",'User'[Name]),SELECTCOLUMNS('CustomerOrders',"Bill",'CustomerOrders'[CustomerName]))
return
IF (CONTAINS(customers,'User'[Name],SELECTEDVALUE ( 'CustomerOrders'[CustomerName])),
CALCULATE ( [Total Amount], intersect(customers,selected ) )

        )

Then when creating Matrix table, what I should add in the rows to display the unified columns correclty
1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, rename that column to the same name in all 3 tables.  Then append all three tables and remove all columns other than this column.  Change the case of this column to upper case and remove duplicates.  Create a relationship (Many to One and Single) from the 3 individual tables to this new table.  To your visual, drag Name from the new table.  Now write the measures.

Hope this helps.


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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors