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
simonGIS
Helper I
Helper I

New field for identifying clients (Salesforce)

Working with Salesforce Objects.

 

I would like to have a new field to define accounts that are considered clients of ours.

 

  • Definition of a client is an account with at least one opportunity that is closed won.
  • Account and Opportunity tables has a 1:M join
  • Opportunity table has a IsWon field which is either True or False

I want to create a new field in Account to check if there is any related opportunities where IsWon = True, and return a true/false response.

 

I am new to DAX, and currently doing some reading through other posts, but if someone could give me a few pointers, would really appreicate it.

 

[Is this account a client] = IF Opportunities.IsWon + True, return True1.jpg

 

 

 

 

 

1 ACCEPTED SOLUTION
ZunzunUOC
Resolver III
Resolver III

Hi @simonGIS , assume that these are your data, you can create the next calculated column on your Customer table:

 

IsCustomer = 
var IdCustomer=Accounts[ACCOUNT]
return
IF(CALCULATE(COUNTROWS(Opportunities);FILTER(Opportunities;Opportunities[Account]=IdCustomer && Opportunities[IsWon]=True))>0;"TRUE";"FALSE")

reply015.png

 

Best Regards,
Miguel

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
ZunzunUOC
Resolver III
Resolver III

Hi @simonGIS , assume that these are your data, you can create the next calculated column on your Customer table:

 

IsCustomer = 
var IdCustomer=Accounts[ACCOUNT]
return
IF(CALCULATE(COUNTROWS(Opportunities);FILTER(Opportunities;Opportunities[Account]=IdCustomer && Opportunities[IsWon]=True))>0;"TRUE";"FALSE")

reply015.png

 

Best Regards,
Miguel

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks.
Can you help me understand the best practise to apply this.

 

  • New measure under the Data View
  • New column under the Data View
  • Edit Queries view - add column - new column 

My feeling is that for the entire report, I will only care about the identified clients, so perhaps makes sense to do this in the edit queries section?  However this would require converting the DAX to M language, any chance you can provide some pointers on what that might look like?

 

 

I had an issue trying to apply this as a new measure:

 

1.jpg

 

Creating a new column in Account table from Data View, initially fails when I use ;

1.jpg

But if I change these to , then it executes.

Any reason?  I saw another post that suggests ; is preferred.

 

 

"assume that these are your data"

I am using the Salesforce connector to grab the data using my credentials.

Hi, on the first hand, you must change my "," per ";".

 

I have used just a calculated column and when I talked about data, it was just a example (you can use your connector without problems).

 

Try again and talk me about the results.

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.