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
stalkerwolf2033
Frequent Visitor

Total times values of a column appears in another column

Hello,

I need to know how to build a measure that allows me to know how many times an ID appears in another column (specifically, column "BOSS").

 

 

Screenshot 2022-05-28 232644.png

 

Measure should drop John: 2, because he is the boss of Andy and Tom

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@stalkerwolf2033 

Create the following measure and apply

ID Count in Boss = 
VAR __ID = SELECTEDVALUE(Table1[ID])
RETURN
CALCULATE(
    COUNTA( Table1[BOSS] ),
    Table1[BOSS] = __ID,
    REMOVEFILTERS(Table1)
)

Fowmy_0-1653799537174.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @stalkerwolf2033,

 

May I know whether you have solved this issue? If you still have problems on it, could you please let me know whether there is any other table in your model and how you create relationships for these tables? In addition, how you create your visual? Thanks in advance!

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

Fowmy
Super User
Super User

@stalkerwolf2033 

Create the following measure and apply

ID Count in Boss = 
VAR __ID = SELECTEDVALUE(Table1[ID])
RETURN
CALCULATE(
    COUNTA( Table1[BOSS] ),
    Table1[BOSS] = __ID,
    REMOVEFILTERS(Table1)
)

Fowmy_0-1653799537174.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi! I tried this but it returns the same number for all columns 

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.