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 function returns all rows from table instead of only related ones

Hello,

I two relationships between two tables.
I am trying to use the inactive one in only one measure by using the USERELATIONSHIP function.

However, the result I am getting is the total number of rows in my table, when there should be much less.

 

The measure I have used looks like that:

TEST = 

CALCULATE(SUM('FNG activity'[qty]),

USERELATIONSHIP('FNG activity'[sku], 'Rear Bumpers List'[sku]))

1st table name: FNG activity (related column: sku)

2nd table name: Rear Bumpers list (1st related column and ACTIVE relationship: manufacturer sku
                                                         2nd related column and INACTIVE relationship: sku)

The value I should get is 792 and instead I am getting total number of rows in FNG activity table: 4747

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , hop you are using this in measure not column ,

 

In case you do not want to include blank values in the join  then add

 

TEST =
CALCULATE(SUM('FNG activity'[qty]),
USERELATIONSHIP('FNG activity'[sku], 'Rear Bumpers List'[sku]) ,not(isblank('Rear Bumpers List'[sku])))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you @amitchandak 

It worked perfect!

amitchandak
Super User
Super User

@Anonymous , hop you are using this in measure not column ,

 

In case you do not want to include blank values in the join  then add

 

TEST =
CALCULATE(SUM('FNG activity'[qty]),
USERELATIONSHIP('FNG activity'[sku], 'Rear Bumpers List'[sku]) ,not(isblank('Rear Bumpers List'[sku])))

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.