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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
smcorrigan
New Member

Calculate Columns across different tables

Hello all

 

I am very new to DAX and Power BI so I apoligise for the probably simple question...

 

I have six different database tables that contain Nationality information. Each table represents a different Business Unit, however, all the tables contain the same information (the exact same software system for all). I am looking to collate two pieces of information:

 

1) The total number of nationalities

2) Total number 'on-roll'

 

I have managed to complete this for each Business Unit individually, however, I am now trying to get a Group level view, and am struggling...

 

Per Business Unit I have the fields txtNationality and txtID (filtered to 1 which is system status for current). I simply Count Distinct ID numbers against each Nationality which seems to work fine. I now need to do this for all 6 Business Units together, though it could be possible that across the 6 different systems someone may have the same txtID number.

 

Can anyone please advise how this may be completed? I have read about using the RELATED function, ADD COLUMNS, SUM etc. but cannot seem to get this to work. I'm not sure I am managing the relationships between the tables correctly.

 

Thanks very much in advance for any help.

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@smcorrigan

 

When you import data into Power BI Destkop, it will detect the relationships between tables, you can also click "Manage Relationships" to edit the relationships. 

Capture22.PNG

With relationships, you can join your data in DAX using RELATED() function. Without relationships, you can still join tables using LOOKUPVALUE(). For more information, please see: From SQL to DAX: Joining Tables

 

Also you can join tables using "Merge Queries" in Query Editor as @kdejonge mentioned.

 

Regards,

kdejonge
Microsoft Employee
Microsoft Employee

I would probably look into creating a single table from the 6, that will make things easier. Here is an article that shows an example:

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-shape-and-combine-data/ 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors