Forum Discussion
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
- lbendlinSuper User
I created a guide to create a bridge tablewhy 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.
- kasifeHelper V
lbendlin I would like to do this because my dimension tables are many to many. In this case, for example, I can have one or more projects for each broker and I can have one or more brokers for each project. I need to do some calculations that involve, for example, counting brokers per project, etc. I don't know if there was another way to do this.
- lbendlinSuper User
It might be better to do that via the common fact table.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523