Matching two Dates to my Calendar table
Hi
I have one table with many dates and I would like to join the date to my Calendar table for a few cards and the change it to the other cards. Is this possible? As i have tried but all the cards update to the latest join.
RE: Matching two Dates to my Calendar table
Hi Meena,
Thank you for the forum question.
Yes, this is possible, but not by switching relationships directly, because Power BI relationships apply to the entire model, not individual visuals.
What you need is to use multiple relationships and control them inside measures.
Recommended solution: inactive relationships with USERELATIONSHIP
1. In your model, connect your Calendar table to each date column in your fact table.
o Keep one relationship active (for example, to OrderDate).
o Set the others (for example, DeliveryDate, InvoiceDate) as inactive.
2. Create separate measures for each date you want to use.
Example:
Total Sales (Order Date) =
CALCULATE(
[Total Sales],
USERELATIONSHIP('Calendar'[Date], 'Fact'[OrderDate])
)
Total Sales (Delivery Date) =
CALCULATE(
[Total Sales],
USERELATIONSHIP('Calendar'[Date], 'Fact'[DeliveryDate])
)
3. Use these measures in different cards:
o One card uses the Order Date measure
o Another card uses the Delivery Date measure
Each visual will now use its own date logic independently.
Why your current approach changes all cards
When you change which relationship is active in the model, Power BI recalculates all visuals using that active relationship. This is expected behaviour because relationships are global, not per-visual.
Alternative options
You could duplicate the Calendar table and connect each copy to a different date column, but this makes the model less efficient and harder to maintain.
Another advanced method is to use TREATAS in measures, but USERELATIONSHIP is simpler and is the standard approach.
Summary
• You cannot switch relationships per visual directly.
• Use inactive relationships and USERELATIONSHIP in measures.
• Assign different measures to different cards to control which date is used.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector


