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! Learn more

Reply
George1973
Helper V
Helper V

Calculate Intercompany Sales

Hi All,

Please assisit with the following issue:
I have a following sample data showing sales per customer and seller. The problem is that in the customer list I have also "sellers" meaning that those companies have sales between each others too,
I need to create a measure calculating:

a) Sales for only those companies which are the sellers in the same time - Let's call that measure "Intercompany Sales"

Customer_IDSeller_IDAmount
12887
22681
33455
4352
55713
66627
72554
81369
91601
103786
113637
123862
133987
143179
153262
163581
173413
183661
193434

 

Thanks in advance

2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

I think this approach will work in your measure expression

 

Sales From Companies that are also Sellers =
CALCULATE (
    SUM ( Table[Amount] ),
    TREATAS (
        VALUES ( Table[Seller_ID] ),
        Table[Customer_ID]
    )
)

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

@mahoneypat  Thanks a lot.

What a wonderful measure -   TREATAS ().. I did not hava a clue about it.
Now I know, thanks to your support.

Best regards,

 

George

View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

I think this approach will work in your measure expression

 

Sales From Companies that are also Sellers =
CALCULATE (
    SUM ( Table[Amount] ),
    TREATAS (
        VALUES ( Table[Seller_ID] ),
        Table[Customer_ID]
    )
)

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@mahoneypat  Thanks a lot.

What a wonderful measure -   TREATAS ().. I did not hava a clue about it.
Now I know, thanks to your support.

Best regards,

 

George

George1973
Helper V
Helper V

One clarification:

It should be a universal measure independent on the numbers of the "sellers" and "customers"

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.