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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
saudalomairi
Frequent Visitor

Relationships - How to make One Column to Multi Column Relationship

Salaam All

 

I have a below case where I want to create a relation between Polygon Table and Well Name Table, The issue is that can't figure out how to do it, as you can see the Polygon column in polygon table has to filter both polygon1 and polygon2 in Well Name table. 

 

for example, if i choose "B" from polygon table, it should filter the wells "W2" and "W3", by mean any well with "B" polygon either in polygon1 or polygon2.

saudalomairi_0-1673844526581.png

Your help is really appreciated.

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @saudalomairi  ,

I create a sample pbix file(see the attachment), please check if that is what you want.

1. Please DO NOT create any relationship between the table 'Polygon' and 'Well Name'

yingyinr_1-1673942877971.png

2. Create a measure as below 

Flag =
VAR _selpolygons =
    ALLSELECTED ( 'Polygon'[Polygon] )
VAR _selp1 =
    SELECTEDVALUE ( 'Well Name'[Polygon1] )
VAR _selp2 =
    SELECTEDVALUE ( 'Well Name'[Polygon2] )
RETURN
    IF ( _selp1 IN _selpolygons || _selP2 IN _selpolygons, 1, 0 )

3. Create a visual and apply the visual-level filter on the visual with the condition(Flag is 1)

yingyinr_2-1673943029147.png

If the above one can't help you get the expected result, please provide more raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @saudalomairi  ,

I create a sample pbix file(see the attachment), please check if that is what you want.

1. Please DO NOT create any relationship between the table 'Polygon' and 'Well Name'

yingyinr_1-1673942877971.png

2. Create a measure as below 

Flag =
VAR _selpolygons =
    ALLSELECTED ( 'Polygon'[Polygon] )
VAR _selp1 =
    SELECTEDVALUE ( 'Well Name'[Polygon1] )
VAR _selp2 =
    SELECTEDVALUE ( 'Well Name'[Polygon2] )
RETURN
    IF ( _selp1 IN _selpolygons || _selP2 IN _selpolygons, 1, 0 )

3. Create a visual and apply the visual-level filter on the visual with the condition(Flag is 1)

yingyinr_2-1673943029147.png

If the above one can't help you get the expected result, please provide more raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

amitchandak
Super User
Super User

@saudalomairi , Inactive join and userelationship in measure

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors