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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
caito103
Helper I
Helper I

Calculate Distinct Count based in other column value

Hello,

Im trying to count each client of the company if the cell have in the "Clase" column the data "Factura (v)". But, in "Codlegal" column i have multples times each code, so i need to use distinct to no repeat each one.

 

Im trying with:

 

NumClientes = CALCULATE ( DISTINCTCOUNT(Hoja2[Codlegal]);Hoja2[Clase] = "Factura (v)")

 

But i get "30,23K" and are only 2.916. I tried with differents formulas but i cant get it, any advice?

 

1 ACCEPTED SOLUTION
cs_skit
Resolver IV
Resolver IV

solution should be

 

COUNTROWS(FILTER(ALL(Table);Table[column]="Factura (v)"))

 

 

if you don't want the independent context like if you want it to change when you slice remove the ALL

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@caito103

 

Your measure supposes to work. Make sure your slice it with client field.

 

54.PNG

 

Regards,

cs_skit
Resolver IV
Resolver IV

solution should be

 

COUNTROWS(FILTER(ALL(Table);Table[column]="Factura (v)"))

 

 

if you don't want the independent context like if you want it to change when you slice remove the ALL

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.