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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Relationship does not recognize same value.

Hello,

 

I have an issue i can not get my head around. I have 2 tables; Resources and ResourceRollen (roles) With a relation between the two:

Screenshot_46.png

 

Inside these tables i have the following values: 

 

Screenshot_45.png

 

IsResourceActive is a calculated column, like this: 

 

IsResourceActive = IF(RELATED(ResourceRollen[ResourceRollen]) = Resources[Resource Name],1,0)

 


I would expect a 1 at all of these values. But apparently it cant link Omgevingsmanager grondzaken to Omgevingsmanager grondzaken. 

Both fields are text fields. 

It has to be a calculated column and not a measure, because i need the field in page filters. 

Anyone an idea?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Did you check for any extra spaces in the other table? Sometimes, it happens. If possible count the characters of both the tablefields to see if it matches.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

It works fine on my side. Can you share your file if you don't have any Confidential Information?

2.PNG

3.PNG

 

Best Regards,

Jay

Anonymous
Not applicable

Yeh, i have the same.. When i try to recreate the data it works fine. But when i load it in from the database i get this stuff.. Its so wierd. 

So unfortunately no sample data is possible, sorry.

Anonymous
Not applicable

Did you check for any extra spaces in the other table? Sometimes, it happens. If possible count the characters of both the tablefields to see if it matches.

Anonymous
Not applicable

This was it indeed, cant believe i didnt think of it. A clean and/or a trim didnt work so i just force replaced the values, no idea what the extra character was.

amitchandak
Super User
Super User

@Anonymous , seems fine. Try like

IsResourceActive = IF(countx(filter(Resources, ResourceRollen[ResourceRollen] = Resources[Resource Name]),Resources[Resource Name])>=1,1,0)

You might have to swap Resources and ResourceRollen in the above calculation as per need like

 

new column in the resource table

IsResourceActive = IF(countx(filter(ResourceRollen, ResourceRollen[ResourceRollen] = Resources[Resource Name]),ResourceRollen[Resource Name])>=1,1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak thank you for your suggestions. 

When i try the first suggestion, i had to change it to this:

IsResourceActive = IF(countx(filter(Resources, RELATED(ResourceRollen[ResourceRollen]) = Resources[Resource Name]),Resources[Resource Name])>=1,1,0)

This gives a 1 on every field, even if it is not in resourcerollen. 

The second one i changed to this:

IsResourceActive = IF(countx(filter(ResourceRollen, ResourceRollen[ResourceRollen] = Resources[Resource Name]),RELATED(ResourceRollen[ResourceRollen]))>=1,1,0)

I added related, because else it cant recoqnize the column there. But i get the same result. 

 I went further and tried this:

IsResourceActive = IF(countx(filter(ResourceRollen, ResourceRollen[ResourceRollen] = Resources[Resource Name]),Resources[Resource Name])>=1,1,0)

It also gives the same result. 
Unfortunately no solution yet.

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.