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
HelenBrunyee
Helper I
Helper I

USERELATIONSHIP is not working - What am I doing wrong?

Hello Everyone,

 

I was hoping someone could help me with this - I've been banging my head against the desk with this one, I can't seem to figure it out!

 

Context:

I have a date table, linked to my data table with an active relationship to 'Issued Date'. There are also a couple more Date columns, for which I have also created two more inactive relationships to the date table for. One of these is 'Debt Recovery Sent Date'.

 

Problem:

When using the USERELATIONSHIP function to calculate my query (how many issued tickets were sent to debt recovery each month), it doesn't seem to want to link to the date table, and just throws back blank date in my table.

 

The DAX meaure I have used is:

Total sent to Debt Recovery= CALCULATE([Total Issued], USERELATIONSHIP('Date Table'[Date],R_Issued[Debt_Recovery_Sent_Date]))

[Total Issued] = COUNTROWS('R_Issued')

 

I have also tried switching the USERELATIONSHIP part round, as such:

Total sent to Debt Recovery= CALCULATE([Total Issued], USERELATIONSHIP(R_Issued[Debt_Recovery_Sent_Date],'Date Table'[Date],))

 

Both produce the following, the 'Date' column is the Date column in the Date table (shown here with and without the Total Issued measure):

 

DR.PNGDR.PNG

 

 

 

 

For reference, the relationships look like this:

 

Relationship.PNG

 

 

I'm at a loss at what to try next, so any help would be much appreicated!

 

Thank you! 

 

Helen

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

This kind of behaviour appears when the relationship is not actually functioning. I recommend checking testing the data types and formatting between the columns. E.g. Here I formatted date column to Text and the relationship broke down:

ValtteriN_0-1641479342178.png
Back to date format:
ValtteriN_1-1641479383383.png

I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

This kind of behaviour appears when the relationship is not actually functioning. I recommend checking testing the data types and formatting between the columns. E.g. Here I formatted date column to Text and the relationship broke down:

ValtteriN_0-1641479342178.png
Back to date format:
ValtteriN_1-1641479383383.png

I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!

 





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

Proud to be a Super User!




Aha! That seemed to do it! My Debt Recovery Sent Date column was set to Date/Time in the Query Editor, so I changed it to Date & this seemed to do the trick

 

Thank you so much for your help - lifesaver! 😄

 

Best wishes,

Helen

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.