Forum Discussion

kasife's avatar
kasife
Helper V
2 years ago
Solved

Validate bridge table

Hi Guys,

I created a guide to create a bridge table, but I'm not sure if it's correct. Because this measure ends up giving me all the possibilities between the two dimension tables. What would be the way to do this correctly?

 

    SELECTCOLUMNS(
        CROSSJOIN(projetosReaal, _corretores),
        "ID_projetos", projetos[idempreendimento],
        "ID_corretores", _corretores[idcorretor]
    )

 

  •  

    Total brokers = COUNTROWS(DISTINCT(UNION(
        SELECTCOLUMNS(Leads,"Broker",[idcorretor]),
        SELECTCOLUMNS(pastas,"B",[idcorretor]),
        SELECTCOLUMNS(ccvs,"B",[idcorretor]),
        SELECTCOLUMNS(Repasses,"B",[idcorretor]))))
    
    // distinct count of brokers that are in the tables: Leads, pastas, ccvs and repasses
    // The tables are related by ID, but the broker count must be by name

     

10 Replies

  • I created a guide to create a bridge table

    why would you do that? 🙂 Is there a solid business reason behind that?

     

    What you are doing is re-inventing SUMMARIZECOLUMNS with unrelated tables

     

    Read about TREATAS - it's a way to project filters from one table to another, especially if they are not related.