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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
cokeyng
New Member

How to avoid aggregation?

Hi all,

 

I am new to Power BI. One problem I am trying to solve is to refer to a column in a different table in my formula. But the inner join seems to multiple the number of rows and sum them up, when I am using the sumx function. 

 

In SAS, I was able to manage that by using the AggregateTable and Table functions, like this:

 

AggregateTable(_Sum_,

Table(_Max_, Fixed('Program'n, 'Special Program'n, 'Quartile'n, 'Fiscal Year'n, 'Site'n, 'Address'n),

'X_Actual Resident Days'n))

 

Is there a best practice to handle this situation in Power BI?

 

Thanks

 

Cokey

1 ACCEPTED SOLUTION
rubayatyasmin
Super User
Super User

@cokeyng 

 

you can use RELATED() / RELATEDTABLE() to reference column from another table. make sure tables are connected in the model view. 

 

example: suppose you have a table named TableA and you want to sum up the 'X_Actual Resident Days' from another table named TableB, you can create a measure as:

Total_X_Actual_Resident_Days =
SUMX(
RELATEDTABLE(TableB),
TableB[X_Actual Resident Days]
)

 

refer:

 https://learn.microsoft.com/en-us/dax/related-function-dax

https://learn.microsoft.com/en-us/dax/relatedtable-function-dax

 

And for duplicating rows, do you have many-to-many relationships? Maybe that is causing the duplicates. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

1 REPLY 1
rubayatyasmin
Super User
Super User

@cokeyng 

 

you can use RELATED() / RELATEDTABLE() to reference column from another table. make sure tables are connected in the model view. 

 

example: suppose you have a table named TableA and you want to sum up the 'X_Actual Resident Days' from another table named TableB, you can create a measure as:

Total_X_Actual_Resident_Days =
SUMX(
RELATEDTABLE(TableB),
TableB[X_Actual Resident Days]
)

 

refer:

 https://learn.microsoft.com/en-us/dax/related-function-dax

https://learn.microsoft.com/en-us/dax/relatedtable-function-dax

 

And for duplicating rows, do you have many-to-many relationships? Maybe that is causing the duplicates. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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