Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Morning Guys, hope its all well!
I have a query where I need a Count of employee role id's. There is a column with the role id and another one with the role names.
I need to be able to do the count based on, for example.
When the measure Counts the total of role ids associated to a particular employee name
Column Role Names
Group Leader
Member
Business unit Leader
In some cases Business unit leader and group leader should considered as the same.
I'll appreciate if anyone has some feedback.
Have a great day 👍
Solved! Go to Solution.
Hi @L-P,
If you would like to count role id for different role names, you may try this Measure.
Count on roles names = CALCULATE(COUNT('Table'[role id]),ALLEXCEPT('Table','Table'[role names]))
If you would like to count role id for one specific role name, you can try this Measure and make some changes per your needs.
Count for one role name = CALCULATE(COUNT('Table'[role id]),FILTER( ALL('Table'),'Table'[role names]="lisa"))
Sample data:
The result:
Also, attached the pbix file.
If this 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
Hi @L-P,
If you would like to count role id for different role names, you may try this Measure.
Count on roles names = CALCULATE(COUNT('Table'[role id]),ALLEXCEPT('Table','Table'[role names]))
If you would like to count role id for one specific role name, you can try this Measure and make some changes per your needs.
Count for one role name = CALCULATE(COUNT('Table'[role id]),FILTER( ALL('Table'),'Table'[role names]="lisa"))
Sample data:
The result:
Also, attached the pbix file.
If this 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
@L-P You can use the pattern COUNTAX(FILTER(...),...) or CALCULATE(COUNTA(...),...)
(1) CO-CU Excel to DAX Translation - Microsoft Power BI Community
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
26 | |
17 | |
12 | |
12 | |
10 |
User | Count |
---|---|
32 | |
25 | |
16 | |
14 | |
13 |