Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to link multiple values with multiple dates fields, using USERELATIONSHIP? Or not?

Hey guys,

 

This is my first time asking a question, because I've finally hit a roadblock I can't seem to cross! Hope I can explain it clearly enough. Any input would be super appreciated! Thanks, in advance!

 

Our company sells service agreements to customers and would like to see the renewal rates of these agreements 

(i.e. Renewed Agreements / Closed Agreements = Renewal Rate;  95 / 100 = 95% Renewal Rate).

 

All 'Open' agreements use a 'Start Date'.

Once an agreement closes, we classify it as 'Closed' and use an 'End Date'.

If a salesperson reups the customer, the same agreement is classified as 'Open' and 'Renewed', which both get a 'Start Date'.

 

I have a dim_Dates table, which I linked to the 'Start Date' field, in the fact_Agreements table (therefore, this is the active relationship).

 

I have written measures that count all the records that are: Open, Closed, and Renewed.

 

The counts for Open and Renewed are correct, when I filter (using a date slicer based on the dim_Dates table), but the counts for Closed agreements are always incorrect.

 

I understand that this happens because the relationship between the 'End Date' field and the dim_Dates table is inactive, but I don't know how to solve the problem.

 

I've attached a Visio diagram, which I've been using to try and visualize the problem. In the diagram, I've included the formula I wrote, to get around this problem.

 

Date Relationships.png

 

I've tried to be as concise (and as clear) as possible, so I hope this all makes sense. Again, thanks in advance for any help or suggestions!

 

Regards,

 

Rue

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

To what I can read you have an inactive relationship between End Date and your Dimension so you just need to make a USERRELATIONSHIP to use it.

 

Something like:

 

Closed = CALCULATE (COUNTDISTINC (Table[Code]); USERRELATIONSHIP (Table[End Date]; Date[Date]))

 

This is just a example the part that is needed for your calculation to work is the bold one that is activation of the userrelation based on end date.

 

On your measure in the image you have USERRELATIONSHIP on Start Date and that will not return the expect result since you keep returning to start date and not end date between visuals and slicer.

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous,

 

To what I can read you have an inactive relationship between End Date and your Dimension so you just need to make a USERRELATIONSHIP to use it.

 

Something like:

 

Closed = CALCULATE (COUNTDISTINC (Table[Code]); USERRELATIONSHIP (Table[End Date]; Date[Date]))

 

This is just a example the part that is needed for your calculation to work is the bold one that is activation of the userrelation based on end date.

 

On your measure in the image you have USERRELATIONSHIP on Start Date and that will not return the expect result since you keep returning to start date and not end date between visuals and slicer.

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix Thanks so much!! I've been working on this problem for hours. I really appreciate your help!

 

Best regards,

 

Rue

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.