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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors