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

Userelationship can only be used in calculate but already is.

Hey there to whom ever is reading this,

 

I've been working on a project now I'm trying to put in a measure that will use a inactive relationship only for a single graph, however when attempting this I get back an error saying "USERELATIONSHIP function can only be used in the CALCULATE function." while it already is in a Calculate function (code provided below). I assume that I am making a mistake on how to write this piece of dax code myself since I am still quite new to PowerBI as a whole I would appreciate any help you might be able to offer so I can get this to work 🙂 

Date = 
    CALCULATE(
        USERELATIONSHIP(Date_Dimensions[Date],TT_WK_DETAILS[TT_DATE])
    )



Thank you so much in advance!

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

USERELATIONSHIP is a calculate modifier. You need to use it with a measure/expression as the first term.

 

Date = 
    CALCULATE( [Your Measure],
        USERELATIONSHIP(Date_Dimensions[Date],TT_WK_DETAILS[TT_DATE])
    )

 

Pat

Microsoft Employee

View solution in original post

3 REPLIES 3
ppm1
Solution Sage
Solution Sage

USERELATIONSHIP is a calculate modifier. You need to use it with a measure/expression as the first term.

 

Date = 
    CALCULATE( [Your Measure],
        USERELATIONSHIP(Date_Dimensions[Date],TT_WK_DETAILS[TT_DATE])
    )

 

Pat

Microsoft Employee
Anonymous
Not applicable

I understand so a count for example? However I am using dates here I am unsure of what would be a good measure to use for this excuse my ignorance still learning.

 

Anonymous
Not applicable

For anyone else running into this I figured it out using this inactive relationship I managed to average the worked hours using an average command in within the calculate I hope it helps for anyone in the future 🙂

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.

Top Solution Authors