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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Return a specific value based on aggregated data and applying criteria

Hi,

How do I create a value that is based on multiple inputs/criteria in multiple rows and columns of data?

 

Example:

  • Any given company has a single 'Global Company ID' (GCID), which may consist of multiple 'Local Company IDs' (LCID). In the example below I show two companies. 
  • Each of those LCID's has a specific value (i.e. Cust of Prod1, Non Cust w/ Opty, etc...), hence can be described as a Customer with Yes or No by row - displayed in the 'Local Customer'-column. 
  • From a 'GCID'-perspective, however, this would be conflicting data, because you can apply both Local Customer values, Yes's and No's, for the company with the GCID ABC123456

Desired outcome - see last column:

Which formula can I use to create a column that:

  • for each GCID
  • looks all the related LCID's
  • searches for 'YES's in that 'Local Customer' column
  • displays YES for each row of the 'Global Customer'-column - if it finds a single 'YES' in the 'Local Customer'-column, OR
  • displays NO for each row of the 'Global Customer'-column - if it does NOT find a single 'YES' in the 'Local Customer'-column for a given GCID

 

Chris_2019_3-1662565661710.png

 

Thanks for your help!

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

 

Measure = 
  VAR __Table = FILTER('Table',[Local Customer] = "Yes")
  VAR __Count = COUNTROWS(__Table) + 0
RETURN
  IF(__Count > 0, "YES", "NO")

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

 

Measure = 
  VAR __Table = FILTER('Table',[Local Customer] = "Yes")
  VAR __Count = COUNTROWS(__Table) + 0
RETURN
  IF(__Count > 0, "YES", "NO")

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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