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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
relentless226
Regular Visitor

Help needed for custom Yes/No measure involving a table that has multiple "Yes" and "No" results

Hello All:

 

I have the following tables Teams and Projects, they are related in a one to many relationship by Team Name:

 

Teams Table:

Team NameTeam Type
A teamRegional
B teamDepartment

 

Projects Table:

Team NameProject NameQualified Project
Team AProject AYes
Team AProject BNo
Team BProject CNo
Team BProject DNo

 

What I want is to have a table visual that will have one row per team, with a custom column or measure that shows "Yes" if there is at least one project with "Yes" in the qualified column or "No" if there are no projects with "Yes".  See below:

Team NameTeam TypeQualified Projects?
A TeamRegionalYes
B TeamDepartmentNo

 

If I pull the Qualified Projects field (which is a custom column based on multiple criteria using the Switch function) I would get two rows for Team A, representing the two projects.  I know I need some sort of If function probably.

 

How would you solve this in the best way?  

 

Thanks!

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @relentless226 

 

In this case you can get away with a relatively simple measure:

 

Qualified Project Measure = 
MAX ( Projects[Qualified Project] )

 

This relies on the ranking of text where "Yes" > "No"

 

Alternatively something like this that doesn't rely on the text sort order:

Qualified Project Measure = 
IF ( 
    CALCULATE(
        NOT ISEMPTY ( Projects ),
        Projects[Qualified Project] = "Yes"
    ),
    "Yes",
    "No"
)

 

 Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Drag Team Name and Team Type fields from the Teams Table and write this measure

=if(calculate(countrows(Teams),'Projects'[Qualifies projects])>=1,"Yes","No")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
OwenAuger
Super User
Super User

Hi @relentless226 

 

In this case you can get away with a relatively simple measure:

 

Qualified Project Measure = 
MAX ( Projects[Qualified Project] )

 

This relies on the ranking of text where "Yes" > "No"

 

Alternatively something like this that doesn't rely on the text sort order:

Qualified Project Measure = 
IF ( 
    CALCULATE(
        NOT ISEMPTY ( Projects ),
        Projects[Qualified Project] = "Yes"
    ),
    "Yes",
    "No"
)

 

 Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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