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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
biswad
Advocate I
Advocate I

How 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.

 

OrganistationIDTotal_Role
Ab12232
Ab12232
Ab12232
Bc13321
Bc13321

 

I'm expecting the measure should count only 1 role against each ID. So the total should be 3 not 8

ResultTotalRole
Ab2
Bc1
1 ACCEPTED SOLUTION

@biswad  add ID to measure 

= SUMX( SUMMARIZE('table','table'[Organistation],'table'[ID],'table'[Total_Role]),[Total_Role])

DimaMD_0-1695121248653.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

6 REPLIES 6
RSC
Helper I
Helper I

Hi @biswad ,

The Simplest way of doing that is, use SUMMARISE function

TotalRole = 
SUMX(
    SUMMARIZE('Table', 'Table'[Org], 'Table'[ID]),
    1
)



RSC_0-1695120260977.png

 



DimaMD
Solution Sage
Solution Sage

Hi @biswad  try it

= SUMX( SUMMARIZE('table','table'[Organistation],'table'[Total_Role]),[Total_Role])

DimaMD_0-1695119672928.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

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. 

@biswad  add ID to measure 

= SUMX( SUMMARIZE('table','table'[Organistation],'table'[ID],'table'[Total_Role]),[Total_Role])

DimaMD_0-1695121248653.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Thank you, this works, I think I have an issue with my data. but I got an idea how to achieve it through your helpful query.

Thank you, this works, I think I have an issue with my data. but I got an idea how to achieve it through your helpful query.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.