Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
1 year ago
Solved

Inputs, Outputs and Differences

Hello everyone

I am making a balance scorecard, with entries and exits of the municipalities, and then the difference between the two.

For this I have a table with three fields: CT ISLAND, RESI ISLAND, Counter. This calculates me between the two communes of Municipalities how many it has. That is, each row is the result of MunicipalityCT to MunicipalityResi or vice versa, and it may be the case that it has different results for the same combination of municipalities:

The fact is that when I try to do the subtraction, the difference for a municipality between the two fields comes out to zero, since it only detects one of them and not both.

The measurements I use to calculate the entrances and exits are:

IslandsInputs=CALCULATE(

SUM('Consulta1'[num_contratos]);

Query1[ISLAND CT] = SELECTEDVALUE(Query1[ISLAND CT]);

'Consultation1'[CT ISLAND] <> 'Consultation1'[Residence ISLAND]

)

DeparturesIslands=

CALCULATE(

SUM('Consulta1'[num_contratos]);

Query1[RESIDENCE ISLAND] = SELECTEDVALUE(Query1[Residence ISLAND]);

'Consultation1'[Residence ISLAND] <> Consultation1[CT ISLAND]

)

BalanceIslands = [IslandsTickets]-[Island Departures]

I hope you can help me to see the light. Thank you very much in advance

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Syndicate_Admin ,

     

    Maybe you should create table slicer about [ISLAND CT] and [Residence ISLAND]. You can refer to demo like below:

    DeparturesIslands = 
    CALCULATE(
        SUM('Consulta1'[num_contratos]),
        'Consulta1'[RESIDENCE ISLAND] = SELECTEDVALUE('slicer'[RESIDENCE ISLAND]),
        'Consulta1'[RESIDENCE ISLAND] <> 'Consulta1'[CT ISLAND]
    )
    IslandsInputs = 
    CALCULATE(
        SUM('Consulta1'[num_contratos]),
        'Consulta1'[CT ISLAND] = SELECTEDVALUE('slicer2'[CT ISLAND]),
        'Consulta1'[CT ISLAND] <> 'Consulta1'[RESIDENCE ISLAND]
    )

    Best Regards,
    Adamk Kong

     

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

     

    Maybe you should create table slicer about [ISLAND CT] and [Residence ISLAND]. You can refer to demo like below:

    DeparturesIslands = 
    CALCULATE(
        SUM('Consulta1'[num_contratos]),
        'Consulta1'[RESIDENCE ISLAND] = SELECTEDVALUE('slicer'[RESIDENCE ISLAND]),
        'Consulta1'[RESIDENCE ISLAND] <> 'Consulta1'[CT ISLAND]
    )
    IslandsInputs = 
    CALCULATE(
        SUM('Consulta1'[num_contratos]),
        'Consulta1'[CT ISLAND] = SELECTEDVALUE('slicer2'[CT ISLAND]),
        'Consulta1'[CT ISLAND] <> 'Consulta1'[RESIDENCE ISLAND]
    )

    Best Regards,
    Adamk Kong

     

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