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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
richardwg
Frequent Visitor

DAX formula to to sum up certain rows and return that to another row

Hi Everyone, 

I have the following problem that I can't seem to resolve and would appreciate getting assistance in resolving. The table below represents my data, and all the columns except for client and contract are measures that are calculated from various inputs. I want to sum the profit share for all the clients except 'Internal' and then return that value to the contract profit for the internal client, so in the case below, I'd like to get -2.6 returned to the contract profit.

 

ClientContractInvoice Service Fee Rewards Net Service FeeOperating CostProfitProfit SharePaymentContract Profit
InternalSelf-0.0893714.8214.8214.8214.80479014.82xxxxx
Client-1Con-136.92-0.2213936.6636.663.816118-0.782.99 
Client-2Con-227.43-0.1644927.327.32.594748-0.522.08 
Client-2Con-326.39-0.1585326.2626.262.483614-0.521.95 
Client-3Con-417.55-0.1052317.4217.421.157698-0.260.91 
Client-1Con-59.23-0.055389.239.230.95429-0.130.78 
Client-1Con-69.23-0.055239.19.10.951603-0.130.78 
Client-1Con-79.23-0.055739.19.10.950965-0.130.78 
Client-4Con-88.97-0.0548.978.970.489909-0.130.39
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @richardwg 

 

For your question, here is the method I provided:

 

Since you mentioned that the rest of the columns except "Client" and "Contract" are measures, consider the following dax:

 

Total Profit Share = 
SUMX(
    FILTER(
        ALL('Table'),
        'Table'[Client] <> "Internal"
    ),
    'Table'[Profit Share]
)

 

Contract Profit = 
IF(
    SELECTEDVALUE('Table'[Client]) = "Internal",
    'Table'[Total Profit Share],
    BLANK()
)

 

Here is the result.

 

vnuocmsft_0-1727142682229.png

 

Regards,

Nono Chen

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
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @richardwg 

 

For your question, here is the method I provided:

 

Since you mentioned that the rest of the columns except "Client" and "Contract" are measures, consider the following dax:

 

Total Profit Share = 
SUMX(
    FILTER(
        ALL('Table'),
        'Table'[Client] <> "Internal"
    ),
    'Table'[Profit Share]
)

 

Contract Profit = 
IF(
    SELECTEDVALUE('Table'[Client]) = "Internal",
    'Table'[Total Profit Share],
    BLANK()
)

 

Here is the result.

 

vnuocmsft_0-1727142682229.png

 

Regards,

Nono Chen

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

@Anonymous  thank you very much, your solution worked perfectly. 💥

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.