Forum Discussion
Create a Calculated Table from 4 separate tables
I found the problem and posting the solution here as i didnt get reply from anyone.
I used the following DAX query.
CalculatedTable = ADDCOLUMNS (
UserBranch,
"User", RELATED ( User[UserName]),
"Order", RELATED ( 'Order'[Ordernumber]),
"Branch", RELATED(Branch[BranchID])
)
it threw an error initially because the relationship from Branch to Order table was defined as Many to One rather than default value One to One. once i changed it , it worked perfectly.
For what's worth, this is not the best solution. Just because you can create this table in Dax, doesn't mean you should. Best practices is to do the data shaping in power query (get data) and do the modelling only in power pivot.
Read this article I wrote here http://exceleratorbi.com.au/shaping-modelling-power-bi/