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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

DAX expression for dividing one unaggregated column by an aggregated column

Hello,

 

I am relatively new to Power BI and this is my first time posting so I apologize if something isn't clear.

 

I am unable to get an accurate cost per person calculation as it is duplicating some of the values. My data is a bit complex (there are 92 total tables) so I will try to simplify it. The database allows users to submit information about projects. They only complete one submission per year and complete a single form to provide the total of their expenditures per year but then can upload CSVs that contain information about persons served. Each CSV upload is a unique project that the user is running. And each CSV contains aggregate data across 50 questions with each question having its own table in the database.  Some users only one run project but others run multiple projects so will upload more than one CSV. This is a simplification of my data:

 

Financial Table

Submission IDTotal Expenditures
1$100
2$100
3$200

 

Individuals Served Data

Submission IDProject IDIndividuals served
1113
1122
2212
3314

 

The tables are joined on submission ID, however not directly and I am not sure if that is the problem. There is one overarching table that looks like this

Submission IDDate of SubmissionUserLocationCompanyStatus of Submission

which I use for a lot of filtering (for example, I only want approved submissions, not rejected submissions or each report page is focused on one location)

 

The financial table is connected to that with a one to one relationship.

 

The CSV question tables are connected to the overarching table also through submission ID in a one to many relationship

 

When I try to calculate the cost per person, I just want to divide the total expenditure by a sum of the individuals served. So when calculating the measure and using the table visualization I want:

 

Submission IDTotal ExpendituresPersons ServedCost per person
1$100520
2$100250
3$200450

 

Instead I get:

 

Submission IDTotal ExpendituresPersons ServedCost per person
1$200540
2$100250
3$200450

 

I have temporarily solved this by the DAX expression

Measure = DIVIDE (MAX('Financial Table'[Total Expenditures]), SUM('Individuals Served Data'[Persons Served]) )

But this doesn't feel like a good long term solution.

 

Any assistance is greatly appreciated.

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

It works fine in my side:

vjianbolimsft_0-1666924147039.png

please check the columns in your table visual:

vjianbolimsft_1-1666924201232.png

 

Best Regards,

Jianbo Li

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

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

It works fine in my side:

vjianbolimsft_0-1666924147039.png

please check the columns in your table visual:

vjianbolimsft_1-1666924201232.png

 

Best Regards,

Jianbo Li

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

 

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