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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rtv73
New Member

Help creating a new table column based on conditions and relationships from 2 other tables

I would like to create a new column in table Opportunity called Partner.

 

This new column Partner the Opportunity table is to be populated if:

  • There is an entry in OpportunityPartner table where isPrimary=TRUE and Role__c="Reseller"

 

Then take the first match found, and populate the new column by taking the name from the Account table column Name.

 

MicrosoftTeams-image (3).png

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@rtv73 Need more information like relationships to be exact but should be something like:

Opportunity Partner Column = 
  VAR __OpportunityPartner = MINX( FILTER( RELATEDTABLE('Opportunity Partner'), [isPrimary] = TRUE() && [Role_c] = "Reseller" ), [Account_c] )
  VAR __Account = MAXX( FILTER( 'Account', [Account_c] = __OpportunityPartner), [Name])
RETURN
  __Account


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@rtv73 Need more information like relationships to be exact but should be something like:

Opportunity Partner Column = 
  VAR __OpportunityPartner = MINX( FILTER( RELATEDTABLE('Opportunity Partner'), [isPrimary] = TRUE() && [Role_c] = "Reseller" ), [Account_c] )
  VAR __Account = MAXX( FILTER( 'Account', [Account_c] = __OpportunityPartner), [Name])
RETURN
  __Account


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you Greg, I will give it a try!

 

To give you more information about the relationships, here is the info:

 

Opportunity[Id] : Opportunity Partners[Opportunity__c]

1 to Many

 

OpportunityPartner[Partner__c] : Account[Id]

Many to 1

 

Thanks again!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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