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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Cost Allocation

Just starting out and am running into a wall.  need some help with my calcuation. I was able to determine a filtered cost and wish to allocate it in accordance to % of revenue (another table). The departments are all part of a heirarchy as well as locations. Here is my desired result:

Annotation 2020-08-17 173025.jpg

 
 
 

Source Tables (3) look like this:

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can create this measure:

Allocated = 
IF (
    SELECTEDVALUE ( 'Table'[Departments] ) = "Dept 100",
    SUM ( 'Table'[Expense] )
        - SUM ( 'Table'[Expense] )
            * CALCULATE (
                SUM ( 'Table'[% of Rev] ),
                ALLEXCEPT ( 'Table', 'Table'[Location] )
            ),
    SUMX (
        FILTER ( 'Table', 'Table'[Departments] <> "Dept 100" ),
        'Table'[Expense]
    )
        + MINX ( ALLEXCEPT ( 'Table', 'Table'[Location] ), 'Table'[Expense] )
            * SUM ( 'Table'[% of Rev] )
)

result.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Yingjie 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

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can create this measure:

Allocated = 
IF (
    SELECTEDVALUE ( 'Table'[Departments] ) = "Dept 100",
    SUM ( 'Table'[Expense] )
        - SUM ( 'Table'[Expense] )
            * CALCULATE (
                SUM ( 'Table'[% of Rev] ),
                ALLEXCEPT ( 'Table', 'Table'[Location] )
            ),
    SUMX (
        FILTER ( 'Table', 'Table'[Departments] <> "Dept 100" ),
        'Table'[Expense]
    )
        + MINX ( ALLEXCEPT ( 'Table', 'Table'[Location] ), 'Table'[Expense] )
            * SUM ( 'Table'[% of Rev] )
)

result.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Yingjie Li

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

amitchandak
Super User
Super User

@Anonymous , No very clear

Try these


expense = sum(Table[expense])
% of total = divide(sum(Table[expense]),calculate(sum(Table[expense]), all(Table[department])))

 

Can you share sample data and sample output in table format?

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

Not clear. What is actually required.

Can you please explain more. Please understand that who wants to help are not aware about all other underlying data.

post it with I/p and o/p records and also created measures, columns.

 

If I understand correct with the limited info.

Filter the both tables on 'Filter on this visual' section and select allocate for one and unallocated for other.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.