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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Ben81
Helper I
Helper I

Userrelationship- not working

Hi, hoping I can find help on here as I have tried everything I know and can't ge the thing working. 

I have a date table and a financial table, they have 3 relationships from the Date to Finanace table, so;

Date > Sale Date (1 to *) - Active relationship

Date > Val Date (1 to *) - Inactive

Date > Can Date (1 to *) - Inactive

I removed all other joins to these two tables in my model so they are totally isolated. 

I created a measure to do a sum of a column using the Date to Val Date relationship but instead it filters the column based on the default active relationship Date > Sale.  

z_test1 =
VAR sale=
CALCULATE (
SUM ( <Fin Table>[Amount] ),
FILTER (
<Fin Table>,
<Fin Table>[Type] IN { 2, 3 }
)
)
return
CALCULATE(sale,
USERELATIONSHIP ('Date'[Date], <Fin Table>[Val Date] )
)


Any help would be appreciated 

Thanks,
Ben

1 ACCEPTED SOLUTION

Try

Test measure = CALCULATE( SUM( 'Fin table'[Amount]), 
USERELATIONSHIP('Date'[Date], 'Fin table'[Val date]),
TREATAS( { 2, 3}, 'Fin Table'[Type])
)

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Move the USERELATIONSHIP into the initial CALCULATE, then just return sale

Already tried that and still won't work 

Try

Test measure = CALCULATE( SUM( 'Fin table'[Amount]), 
USERELATIONSHIP('Date'[Date], 'Fin table'[Val date]),
TREATAS( { 2, 3}, 'Fin Table'[Type])
)

Spot on! thanks for the help

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.