Forum Discussion
biswad
Advocate I
2 years agoHow to count unique Values in a duplicate rows
Hi Friends,
I'm working on Power BI report and I have a table which contains list of Organisations and the roles within each of the organisation as below. I would like to count the "Total_Role" under each "ID". How can I achieve this, any help would be greatly appriciated. I'm quite new in dex.
| Organistation | ID | Total_Role |
| Ab | 1223 | 2 |
| Ab | 1223 | 2 |
| Ab | 1223 | 2 |
| Bc | 1332 | 1 |
| Bc | 1332 | 1 |
I'm expecting the measure should count only 1 role against each ID. So the total should be 3 not 8
| Result | TotalRole |
| Ab | 2 |
| Bc | 1 |
biswad add ID to measure
= SUMX( SUMMARIZE('table','table'[Organistation],'table'[ID],'table'[Total_Role]),[Total_Role])
6 Replies
- biswad
Advocate I
Hi, thank you for your solution. But I'm looking to get the sum of the roles based on the ID , and when I use the query you have shared over the ID column it doesn't quite give me the result I was looking at.