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

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

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 Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Users online (8,941)