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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.