Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
5 years ago
Solved

Companies in different tables.

Good night, I wanted to know if anyone can help me with this little problem, if you can write to me to the in-house I would thank you an amount to be able to know more details of the solution, the pr...
  • Anonymous's avatar
    Anonymous
    5 years ago

    I have assumed that you have a calendar table that is connected to the date field of both T1 and T2 and you are using this Date field on the matrix visual.

     

    Conteo de empressas canal 1 = DISTINCTCOUNT(T1[Empresa])
    Conteo de empressas canal 2 = DISTINCTCOUNT(T2[Empresa])

     

    Conteo de empressas utilizaron ambos canales el mismo día = 
    VAR Tcanal1 = VALUES(T1[Empresa])
    VAR T3 = 
        ADDCOLUMNS(
            Tcanal1,
            "Conteo",
            VAR CE = [Empresa]
            RETURN
            IF(CE in VALUES(T2[Empresa]),1,0)
        )
    RETURN
    SUMX(T3,[Conteo])

     This will give you the following result.

     

    Because of the filter context from the Calendar table, the cardinality of the tables used in the evaluation of the measures will be limited to that particular date's records. That way the processing load will not be high.

     

    Número de registros de la Tabla 1 en el contexto de filtro actual = COUNTROWS(VALUES(T1))
    Número de registros de la Tabla 2 en el contexto de filtro actual = COUNTROWS(VALUES(T2))