Forum Discussion
Anonymous
5 years agoNot applicable
Conditional relationship for multiple tables
Hi, I have 4 tables logins, ConnectedUsers,FacilityCode, ProviderCode. Basically in ConnectedUsers table i have: Provider_Name System_Code Facility_Code RegisteredUsers AH...
d_gosbell
5 years agoSuper User
Well, I think you could do it in DAX by creating a calculated column in the connected users table something like:
IF(ISBLANK( [Facility_Code]) ,[System_Code], [Facility_Code] )
and then create your relationship on that column. But personally I would typically try and do row level calculations like this in PowerQuery or a source view if I can. It's not such a big deal on most tables if you are only dealing with a few million rows or less. See here https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/ for a discussion of the pro/cons of the two approaches and why it often does not matter.