Forum Discussion
Use a table multiple time
- 2 months ago
Hi ShaunLeMouton,
Hope you're doing well!
So yes, duplicating a table in the semantic model is absolutely possible via a DAX calculated table, and it's the standard pattern for this exact use case.
the clean solution is to create multiple inactive relationships between your user table and your referential table, then use USERELATIONSHIP in your DAX measures.
But if you want the labels directly as columns (which is usually the case here), the better approach is to use calculated columns with RELATED + USERELATIONSHIP, except that combo doesn't work directly. So the real pattern is duplicate the referential table using a calculated table.
In your semantic model, create a second table that's just a copy of your referential:
Nationalities = Countries
This creates a second logical table pointing to the same data. Then:
- Create a relationship between Users[address_country_code] → Countries[code]
- Create a second relationship between Users[nationality_code] → Nationalities[code]
Both relationships are active, each pointing to a different logical table, so there's no ambiguity. You then just use RELATED(Countries[label]) and RELATED(Nationalities[label]) directly as calculated columns, no tricks needed.
Hi
thx for your answers. i use FABRIC , and Direct Lake with my Gold data Lake with my tables.
if i understand i must create in my gold lake a specific table for each case (Nat 1,Nat 2, country1 , country2...) , I need a relation beetween my referential table and my table user ?