Reply
efstel
Helper I
Helper I

Combining Measures and Spreading Proportional Values based on % of whole

I have a group of costs that are allocated throughout 6 areas, however some of those costs are not allocated to any area at all. I want to distribute the unallocated costs proportionally between the 5 or 6 areas based on each areas overall total divided by the sum total of all 6 areas.

I created a measure to determine the % allocation.

%JCIDBilledAmt to OfficeName =

VAR _TotalJCIDBilledAmt =

    CALCULATE(

        [BilledAmt],

        All(Offices[OfficeName]) )

RETURN

DIVIDE(

    [BilledAmt],

_TotalJCIDBilledAmt)

 

efstel_0-1718212261232.png

 

  

 Now… What I want to do is take the $740,992 and multiply it by the 24.67%,… so on, so that amount is spread proportionally over each of the OfficeName.

I ran this formula but it’s not giving me the amount for each area and only giving me a sum total.

GLDTAmount for <Filter> Part3 Null x %JCIDBilledAmt to OfficeName =

[GLDTAmount for <Filter> Part3 Null] * [%JCIDBilledAmt to OfficeName]

efstel_1-1718212261233.png

 

How do I get that $740,992 spread proportionally?

What I also need to do is add the SumAmount to the spread proportioned amount together.

Any help or insight would be appreciated.

1 ACCEPTED SOLUTION

Hi, @efstel 

Thank you very much for the data. I got the output you were expecting using the following DAX expression:

Measure 3 = 
VAR _unallocated_ =  CALCULATE(SUM(OverheadTable[OverheadAmount]),FILTER(ALLSELECTED(OfficeTable), 'OfficeTable'[Office]=BLANK()))
VAR _officename_ = SELECTEDVALUE(OfficeTable[Office])
VAR _prop_ = [%BilledAmounttoOffice]
RETURN IF(_officename_=BLANK(),_unallocated_,_unallocated_*_prop_)

Here are the results:

vjianpengmsft_0-1719211558755.png

I've uploaded the PBIX file I used this time below.

 

 

Best Regards

Jianpeng 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

9 REPLIES 9
efstel
Helper I
Helper I

@v-jianpeng-msft still not working for me.  I have three tables. One has office information, one billing information, one overhead information. I can't get it to spread the unallocated overhead based on the %ofBilledAmounttoOffice.

efstel_1-1718826790747.png

efstel_2-1718826966589.png

efstel_3-1718826991172.png

efstel_4-1718827016066.png

efstel_0-1718826741396.png

 

 

 

Hi, @efstel 

I looked at your screenshot and you have a bit of a lot of data, can you provide a PBIX file that doesn't contain private data so that I can better write a DAX expression that works for you.

 

Best Regards

Jianpeng Li

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

I currently don't have the ablity to upload files. (Not a superuser.) Nevertheless, here's a link:

https://www.dropbox.com/scl/fi/trewbdpor34y47jhsw2fz/Unallocated-Test.pbix?rlkey=8rdr7nvjktwhv2vuy95...

Hi, @efstel 

Thank you very much for the data. I got the output you were expecting using the following DAX expression:

Measure 3 = 
VAR _unallocated_ =  CALCULATE(SUM(OverheadTable[OverheadAmount]),FILTER(ALLSELECTED(OfficeTable), 'OfficeTable'[Office]=BLANK()))
VAR _officename_ = SELECTEDVALUE(OfficeTable[Office])
VAR _prop_ = [%BilledAmounttoOffice]
RETURN IF(_officename_=BLANK(),_unallocated_,_unallocated_*_prop_)

Here are the results:

vjianpengmsft_0-1719211558755.png

I've uploaded the PBIX file I used this time below.

 

 

Best Regards

Jianpeng Li

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

 

 

@v-jianpeng-msftworks great! Only one small problem. When I filter or slice it by an office, it drops the unallocated amount out. Any way to keep that in? I'm assuming I need an ALL function in there?

What I'm doing in addition is adding the newly created measure to the overhead amount to give me the overall overhead. Unallocated Overhead + Allocated Overhead = Total Office Overhead

Hi, @efstel 

Yes, you may need to clear the slicer's selection to keep the unallocated amount. You can ask this new question in a new post so that the rest of the community can help you.

 

Best Regards

Jianpeng Li

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

v-jianpeng-msft
Community Support
Community Support

Hi, @efstel 

Based on your description, I tried to create a table like yours:

vjianpengmsft_0-1718247676549.png

I created a measure using the following DAX expression:

GLDTAmount for <Filter> Part3 Null x %JCIDBilledAmt to OfficeName=
VAR _No_allocation =
    CALCULATE (
        SELECTEDVALUE ( Offices[Amount] ),
        'Offices'[OfficeName] = BLANK ()
    )
VAR _office_name =
    SELECTEDVALUE ( Offices[OfficeName] )
VAR _Proportional = [%JCIDBilledAmt to OfficeName]
RETURN
    IF ( _office_name = BLANK (), _No_allocation, _No_allocation * _Proportional )

Here are the results:

vjianpengmsft_1-1718247820445.png

I've provided the PBIX file used this time below.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

 

Thanks @v-jianpeng-msft. The one problem is that there is no [Amount] in the 'Offices' table. I tried switching out Offices[Amount] with GLDT[Amount] and I get no results.

Any ideas how to remedy this?

Hi, @efstel 

Thank you very much for your reply. Based on your description, I've created a new table as follows:

vjianpengmsft_0-1718592508955.png

The relationship is as follows:

vjianpengmsft_1-1718592545649.png

The DAX expression is as follows:

GLDTAmount for <Filter> Part3 Null x %JCIDBilledAmt to OfficeName = 
VAR _No_allocation = CALCULATE(SELECTEDVALUE('Table'[Amount]),'Offices'[OfficeName]=BLANK())
VAR _office_name = SELECTEDVALUE(Offices[OfficeName])
VAR _Proportional = [%JCIDBilledAmt to OfficeName]
RETURN IF(_office_name=BLANK(),_No_allocation,_No_allocation*_Proportional)

Here are the results:

vjianpengmsft_2-1718592619206.png

I've uploaded the PBIX file I used this time below.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)