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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alarekawek
Frequent Visitor

Get sum of transactions from both entites based on selected entity

Hello,

 

This is going to be a very basic question.

I have a table that shows all intercompany transactions from four different systems. It has information about source system, entity number, and counterparty along with reporting numbers of both entities - looks like follows

Source systemEntityCounterpartyValueReporting no EntityReporting No Counterparty
VAC1001030
VAB2001020
JBA(210)2010
ICA(110)3010

 

I want to be able to compare values reported by the analysed entity - let's say A with how much other entity is reporting and see the differences - for example in it's system A is reporting 100 with C, but C in it's system is reporting (110). 

Reporting no EntityEntityValue entityReporting No CounterpartyCounterpartyValue counterpartyDifference
10A10030C(110)(10)
10A20020B(210)(10)

 

I have a slicer to select "Reporting no" of the entity in question. 

I've tried to use calculate with all function to ignore the filters coming from the 'Reporting no Entity' and based on the selected value to show all balances for the counterparty, but I seem to be missing some part as it does not work correctly - I currently get total for all counterparties like below

Reporting no EntityEntityValue entityReporting No CounterpartyCounterpartyValue counterparty
10A10030C(320)
10A20020B(320)

 

How can I make it show values for individual entities in value counterparty?

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @alarekawek ,

Please try this way:
Use this DAX to create a calculated column:

Value counterparty = 
VAR _CurrentCounterparty = [Counterparty]
VAR _CurrentEntity = [Entity]
RETURN
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        'Table',
        'Table'[Entity] = _CurrentCounterparty && 'Table'[Counterparty] = _CurrentEntity
    )
)

vjunyantmsft_0-1713318320086.png

Then use this DAX to calculate this difference:

Difference = [Value] - [Value counterparty]

vjunyantmsft_1-1713318475541.png

And the final output is as below:

vjunyantmsft_2-1713318509999.png


Best Regards,
Dino Tao
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

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

Hi @alarekawek ,

Please try this way:
Use this DAX to create a calculated column:

Value counterparty = 
VAR _CurrentCounterparty = [Counterparty]
VAR _CurrentEntity = [Entity]
RETURN
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        'Table',
        'Table'[Entity] = _CurrentCounterparty && 'Table'[Counterparty] = _CurrentEntity
    )
)

vjunyantmsft_0-1713318320086.png

Then use this DAX to calculate this difference:

Difference = [Value] - [Value counterparty]

vjunyantmsft_1-1713318475541.png

And the final output is as below:

vjunyantmsft_2-1713318509999.png


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

Thank you very much, this helps me a lot!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.