Forum Discussion
SevsBo
Responsive Resident
1 year agoCannot create single direction one-to-one relationship
I have created a relationship between a generic Date table and a table that containst a Date column. The relationship is identified as one-to-one, given that the date data is quite short and distinct...
Bibiano_Geraldo
Super User
1 year agoHi SevsBo ,
you can override the filter behavior using DAX measures. Instead of relying on automatic relationship propagation, use TREATAS() or USERELATIONSHIP() to explicitly control filtering when needed.
using TREATAS() your DAX will look like this:
CALCULATE(
SUM(YourTable[YourColumn]),
TREATAS(VALUES(DateTable[Date]), YourTable[DateColumn])
)
Example using USERELATIONSHIP() (if you create an inactive relationship):
CALCULATE(
SUM(YourTable[YourColumn]),
USERELATIONSHIP(DateTable[Date], YourTable[DateColumn])
)
Otherwise you will have to change the cardinality to Many to one or One to many, and choose the cross-filter direction to single:
Note: As you can, please avoid to use Many-to-Many Cardinality.
SevsBo
Responsive Resident
1 year agoMy problem is that I literally cannot select anything other than "Both" as a relationship direction when it's one-to-one.