Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Communalité / Communality

French version :

J’ai des contrats contenant tous un certain nombre de tickets.

Ces tickets peuvent être communs ou non à d’autres contrats.

Je cherche à trouver le nombre de tickets communs à une sélection (infinie et dynamique) de contrats.

Exemple :

Je souhaite connaitre le nombre de dossiers communs aux contrats A, B et C.

Je filtre sur les contrat A, contrat B et contrat C.

Le contrat A contient les dossiers D1, D2, D3.

Le contrat B contient les dossiers D1, D2.

Le contrat C contient les dossiers D1, D2, D3.

Le résultat attendu est 2 : il y a 2 dossiers communs au 3 contrats.

 

English version :

I have Contracts that all contain several Tickets.

These Tickets may or may not be common to other contracts.

I try to find the number of common Tickets to a (infinite and dynamic) selection of contracts.

Example:

I want to know the number of Tickets common to selected Contracts A, B and C.

I filter on Contract A, Contract B and Contract C.

Contract A contains the Tickets T1, T2, T3.

Contract B contains the folders T1, T2.

Contract C contains the folders T1, T2, T3.

The expected result is 2 : there are 2 folders common to the 3 selected contracts.

 

The objective is to get this result in a dynamic graph.

Thanks for your help,

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Please refer the Measures:

    flag = 
    VAR COUNT_T = CALCULATE(COUNT('Table'[Ticket]),FILTER(ALLSELECTED('Table'),'Table'[Ticket]=SELECTEDVALUE('Table'[Ticket])))
    VAR COUNT_A = CALCULATE(DISTINCTCOUNT('Table'[Ticket]),ALLSELECTED('Table'))
    Return
    IF(COUNT_T=COUNT_A,1,0)

     

    Measure = CALCULATE(DISTINCTCOUNT('Table'[Ticket]),FILTER(ALL('Table'),[flag]=1))

     

     

    Best Regards,

    Jay

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please refer the Measures:

    flag = 
    VAR COUNT_T = CALCULATE(COUNT('Table'[Ticket]),FILTER(ALLSELECTED('Table'),'Table'[Ticket]=SELECTEDVALUE('Table'[Ticket])))
    VAR COUNT_A = CALCULATE(DISTINCTCOUNT('Table'[Ticket]),ALLSELECTED('Table'))
    Return
    IF(COUNT_T=COUNT_A,1,0)

     

    Measure = CALCULATE(DISTINCTCOUNT('Table'[Ticket]),FILTER(ALL('Table'),[flag]=1))

     

     

    Best Regards,

    Jay