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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors