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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Employee
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
Employee
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.