Forum Discussion

cvinas's avatar
cvinas
Frequent Visitor
8 years ago
Solved

Relationship problem

Hi all,   I have the following scenario:                         I am counting the number of interactions from a sender to a destination and viceversa (depending on sender type: ...
  • v-ljerr-msft's avatar
    8 years ago

    Hi cvinas,

     

    If I understand you correctly, the formula below should work in your scenario. :smileyhappy:

    # Started by Circle = 
    VAR currentSelectIDOrigin =
        MAX ( ActivityxUser[ID Origin] )
    RETURN
        IF (
            COUNTROWS ( ALLSELECTED ( ActivityxUser[ID Origin] ) )
                = COUNTROWS ( ALL ( ActivityxUser[ID Origin] ) ),
            CALCULATE (
                COUNT ( 'ActivityxUser'[Transaction] ),
                'ActivityxUser'[Sender] = "CERCLE"
            ),
            CALCULATE (
                COUNT ( ActivityxUser[Transaction] ),
                FILTER (
                    ALLEXCEPT ( ActivityxUser, ActivityxUser[Date] ),
                    ActivityxUser[ID Destination] = currentSelectIDOrigin
                        && ActivityxUser[Sender] = "CERCLE"
                )
            )
        )
    

     

    Regards