Forum Discussion
Using two different relationships between the same two tables in the same measure - how?
- 1 year ago
Hi D_PBI, you can use USERELATIONSHIP -> https://learn.microsoft.com/en-us/dax/userelationship-function-dax
CALCULATETABLE( agreement, dimDate[Date] >= [Start Date] && dimDate[Date] <= [End Date], -- Filters ExecutionDate USERELATIONSHIP(dimDate[Date], agreement[ReceivedDate]) -- Filters ReceivedDate )If I answered your question, please mark it as Solution
- 1 year ago
Hello D_PBI
Check out this guide on managing multiple date relationships in Power BI.
FilteredTable =
CALCULATETABLE(
'Agreement',
USERELATIONSHIP(dimDate[Date], Agreement[ReceivedDate]),
Agreement[ExecutionDate] >= [MinDate],
Agreement[ExecutionDate] <= [MaxDate]
)Regards,
Ritesh
Community Champion
Please mark the answer if helpful so that it can help others
Hi D_PBI, you can use USERELATIONSHIP -> https://learn.microsoft.com/en-us/dax/userelationship-function-dax
CALCULATETABLE(
agreement,
dimDate[Date] >= [Start Date] && dimDate[Date] <= [End Date], -- Filters ExecutionDate
USERELATIONSHIP(dimDate[Date], agreement[ReceivedDate]) -- Filters ReceivedDate
)
If I answered your question, please mark it as Solution
- D_PBI1 year agoPost Partisan
MattiaFratello thanks for your reply.
Specifying the USERELATIONSHIP function to tell PBI to use the dimDate[Date] <<>> agreement[Received Date] relationship is fine, but how do I instruct the code to use the filtering logic of agreement[Received Date] >= _MinDateLY && agreement[Received Date] <= _MaxDateLY without if affecting the active relationship of dimDate[Date] <<>> agreement[Execution Date] (and the filtering logic for that relationship)?