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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
biswad
Helper I
Helper 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
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.

Top Solution Authors