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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dedelman_clng
Community Champion
Community Champion

Allocating costs from one table to values in another table

I'm hoping someone can point me in the right direction, because I'm starting to think what I'm trying to do can't be done. Smiley Indifferent

 

Data Model:

Server Detail (InstanceID) 1-to-many to BillingDetail (InstanceID, ExtendedCost)

Standard Date table

 

I split ServerDetail into SingleServers and SharedServers based on certain criteria (there is no overlap between SingleServers and SharedServers, and every row from ServerDetail goes into one or the other).

 

So the data model really looks like this:

DM.PNG

 

 

 

 

 

 

 

 

 

 

I need to total up the costs, per month of the SingleServers, and figure out the percentage of each for a given month:

 

Total Cost := CALCULATE(
	sum(BillingDetail[ExtendedCost]),
		 'SingleServers'
	)

%GT := DIVIDE(
		[Total Cost],
		CALCULATE(
			[Total Cost],
			ALLSELECTED(SingleServers[Dept])
		)
	)
1 ACCEPTED SOLUTION

Hi @v-sihou-msft

 

Somehow I made 2 or 3 copies of this thread, but the main one is here:

 

https://community.powerbi.com/t5/Desktop/Allocating-costs-from-one-table-to-values-in-another-table/...

 

I will be sharing PBIX files with both split and non-split tables showing that both methods can work.

 

Thanks,

David

View solution in original post

4 REPLIES 4
dedelman_clng
Community Champion
Community Champion

I'm hoping someone can point me in the right direction, because I'm starting to think what I'm trying to do can't be done. Smiley Indifferent

 

Data Model:

Server Detail (InstanceID) 1-to-many to BillingDetail (InstanceID, ExtendedCost)

Standard Date table

 

I split ServerDetail into SingleServers and SharedServers based on certain criteria (there is no overlap between SingleServers and SharedServers, and every row from ServerDetail goes into one or the other).

 

So the data model really looks like this:

 

 

 

 

 

 

 

 

 

 

 

I need to total up the costs, per month of the SingleServers, and figure out the percentage of each for a given month:

 

Total Cost := CALCULATE(
	sum(BillingDetail[ExtendedCost]),
		 'SingleServers'
	)

%GT := DIVIDE(
		[Total Cost],
		CALCULATE(
			[Total Cost],
			ALLSELECTED(SingleServers[Dept])
		)
	)

I'm hoping someone can point me in the right direction, because I'm starting to think what I'm trying to do can't be done. Smiley Indifferent

 

Data Model:

Server Detail (InstanceID) 1-to-many to BillingDetail (InstanceID, ExtendedCost)

Standard Date table

 

I split ServerDetail into SingleServers and SharedServers based on certain criteria (there is no overlap between SingleServers and SharedServers, and every row from ServerDetail goes into one or the other).

 

So the data model really looks like this:

 

DM.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I need to total up the costs, per month and department, of the SingleServers, and figure out the percentage of each for a given month:

 

Total Cost := CALCULATE(
	sum(BillingDetail[ExtendedCost]),
		 'SingleServers'
	)

%GT := DIVIDE(
		[Total Cost],
		CALCULATE(
			[Total Cost],
			ALL(SingleServers[Dept])
		)
	)

So for example I would get

 

@dedelman_clng

 

In this scenario, since you separate the server detail into two tables, you can't use a single measure to dynamically retrieve the data from two tables and calculate the percentage. The better practice is adding a column in server detail table for tagging single or shared, then you can use ALLEXCEPT() to group your calculation based on this tagging column.

 

Regards,

Hi @v-sihou-msft

 

Somehow I made 2 or 3 copies of this thread, but the main one is here:

 

https://community.powerbi.com/t5/Desktop/Allocating-costs-from-one-table-to-values-in-another-table/...

 

I will be sharing PBIX files with both split and non-split tables showing that both methods can work.

 

Thanks,

David

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