Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

matching two dates my

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Matching two Dates to my Calendar table

Matching two Dates to my Calendar table

Medium priorityVersion 365

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

 

Training courses

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Power BI tip:

Utilize Relationships Effectively

Establish clear and meaningful relationships between tables in your data model. Proper relationships enable Power BI to navigate and aggregate data accurately. Pay attention to cardinality and cross-filter direction when setting up relationships to ensure the results align with your analytical requirements.

View all Power BI hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.