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.
Suppose I Have three columns, Name, Role, & Project that look like this
Project | Role | Name |
A | Owner | Shane |
A | Helper | Shane |
A | Seller | Bill |
B | Owner | Shane |
B | Help | Eric |
B | Seller | Bill |
C | Owner | Jenna |
C | Owner | Eric |
C | Help | Bob |
C | Seller | Eric |
I want to add a calculated column that states if a person has the role of Owner and Helper, it has a "Yes" else it is Blank. I person can more than 1 role in a project but I only care if they have both roles of Owner and Helper. So it would look like the following:
Project | Role | Name | Dup Role Check |
A | Owner | Shane | Yes |
A | Helper | Shane | Yes |
A | Seller | Bill | |
B | Owner | Shane | |
B | Help | Eric | |
B | Seller | Bill | |
C | Owner | Jenna | |
C | Owner | Eric | |
C | Help | Bob | |
C | Seller | Eric |
How would I go about doing this?
Solved! Go to Solution.
Hi @sjrrkb123
create a measure like
Dup Role Check =
var _isRoleOwner = IF(CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Name], Table[Project]), Table[Role]="Owner") > 0, TRUE(), FALSE() )
var _isRoleHelper = IF(CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Name], Table[Project]), Table[Role]="Helper") > 0, TRUE(), FALSE() )
RETURN
IF(_isRoleOwner && _isRoleHelper, "Yes", BLANK())
Hi @sjrrkb123 ,
Try this measure:
Hi @sjrrkb123
create a measure like
Dup Role Check =
var _isRoleOwner = IF(CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Name], Table[Project]), Table[Role]="Owner") > 0, TRUE(), FALSE() )
var _isRoleHelper = IF(CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Name], Table[Project]), Table[Role]="Helper") > 0, TRUE(), FALSE() )
RETURN
IF(_isRoleOwner && _isRoleHelper, "Yes", BLANK())
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |