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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
letiziadistasi
New Member

Count distinct value

Hello!

I have a database where for each accounts there is an employee. There is the case where one or more employee have the same accounts, so the accounts name is duplicated in database. Each Accounts have a market share : A,B,C and I need to count how many acccounts with C there are in my Database related to total of the accounts. The problem is that the formula that I'm using counts the same account several time, for each employee. How can I count just one time the accounts?

In the following the formula that I'm using: 

% Tier C = CALCULATE ( COUNT( Account [Code]) , Filter('Account', 'Account'[TIER] = "C")) / CALCULATE ( COUNT( Account [Code]) , Filter('Account', 'Account'[TIER] = "A" || 'Account [Code]) , Filter('Account', 'Account'[TIER] = "B"|| 'Account [Code]) , Filter('Account', 'Account'[TIER] = "C"))

 

Many thanks!

1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

@letiziadistasi 

 

If account code is duplicate, please use DISTINCTCOUNT

Count Tier C = CALCULATE ( DISTINCTCOUNT( Account [Code]) , Filter('Account', 'Account'[TIER] = "C"))
Total Count = DISTINCTCOUNT( Account [Code])
% Tier C  = Count Tier C/Total Count


Let me know, it works or not

If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

1 REPLY 1
PijushRoy
Super User
Super User

@letiziadistasi 

 

If account code is duplicate, please use DISTINCTCOUNT

Count Tier C = CALCULATE ( DISTINCTCOUNT( Account [Code]) , Filter('Account', 'Account'[TIER] = "C"))
Total Count = DISTINCTCOUNT( Account [Code])
% Tier C  = Count Tier C/Total Count


Let me know, it works or not

If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.