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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculated Column to check if Id column is assigned with all the values in second column

Hi, I am trying to create  preferably calculated column( If not possible then a measure) for the purpose as explained below. Here there are several Team IDs in ‘Column A’ and Roles in ‘Column B’. The condition to be checked is if each ID of first column is assigned with all the Employee Role’ in the entire table (We have 55 ID’s and more than 54 Employee Roles) then output should be true. That is if  Team ID ‘1’ is assigned with all the roles mentioned in ‘Employee Role’ column then output should be true else false.

Jyothishree_0-1711564214719.png

Thank you,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

 

Test =
var _column=
CALCULATE(DISTINCTCOUNT('Table'[Employee Role]),'Table')
var _groupcount=
CALCULATE(DISTINCTCOUNT('Table'[Employee Role]),FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])))
return
IF(
    _column=_groupcount,TRUE(),FALSE())

 

2. Result:

vyangliumsft_0-1711591179304.png

 

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

 

Test =
var _column=
CALCULATE(DISTINCTCOUNT('Table'[Employee Role]),'Table')
var _groupcount=
CALCULATE(DISTINCTCOUNT('Table'[Employee Role]),FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])))
return
IF(
    _column=_groupcount,TRUE(),FALSE())

 

2. Result:

vyangliumsft_0-1711591179304.png

 

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thank you very much @liu Yang

This solution is perfect for the question I posted but  also the requirement is to get the list of missing roles for each Id and the count of missing roles when each ID is selected. Can you please suggest how this can be acheieved.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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