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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Divide monthly sum by value per month

Hello,

 

I have a table of expenses:  Date / Category / Amount

I have a separate table with the average monthly headcount for each month:  Month / Headcount

 

I would like a measure which sums the expenses for a particular month, and divides it by the headcount for same month from the other table to give average expenses per headcount.

 

Ideas?

 

Thank you,

 

Stacey

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can use the following formula:

 

Average Headcount Expenses = 

DIVIDE(SUMX(Expenses, Expenses[Amount]), SUMX(Headcount, Headcount[headcount]))

 

 

As long as you have proper date columns in each table that are linked to a date table, and you use the months as the axis, this formula should do what you need it to do. 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

You can use the following formula:

 

Average Headcount Expenses = 

DIVIDE(SUMX(Expenses, Expenses[Amount]), SUMX(Headcount, Headcount[headcount]))

 

 

As long as you have proper date columns in each table that are linked to a date table, and you use the months as the axis, this formula should do what you need it to do. 

Anonymous
Not applicable

Thank you for your reply, @Anonymous.  When I tried the formula, it divided by the sum of all headcount, rather than the amount per month.  Here are the structures of my tables.  Do I need to change the format of the tables?

 

Thank you,

 

Stacey

 

Headcount.JPGExpense.JPG

Anonymous
Not applicable

I do also have a separate date table which is linked to both the Expenses and Headcount tables.

Anonymous
Not applicable

And you used the months column from your date dimension table as the axis?

Anonymous
Not applicable

That was the problem!  Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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