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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vnqtrang
Helper I
Helper I

Distinctcount except Filtered values

Hi,

 

I would like to use distinct count which excludes the values in 2 filters 

Here are the 2 filters :

 Filter(all(table), LEFT(Table[ColumnName],1)="R")

 Filter(all(table), LEFT(Table[ColumnName],2)="CR")

 

ColumnName
R0000ER23
R0000ER25
R0000ER22
CR099DF12
CR099CV12
CR099ER34
CR099ER40
WP000022
WP000023
WP000023

 

The return result should be 2 (WP000022, WP000023).

 

Thank you in advance.

Tg

1 ACCEPTED SOLUTION

@vnqtrang , Try like

Measure = distinctCOUNT(Table[ColumnName]) -

calculate(distinctCOUNT(Table[ColumnName]), Filter((table), LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR") )

 

 

Measure =

calculate(distinctCOUNT(Table[ColumnName]), Filter((table), not( LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR"))  )

 

or

 

Measure =

calculate(COUNT(Table[ColumnName]), Filter((table), not( LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR"))  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@vnqtrang , Create this measure and plot it with columnname

 

calculate(distinctCOUNT(Table[ColumnName]), Filter((table), LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR") )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This one shows the filtered values. I would like to count the other values except these 2 filtered values. Hope I clear enough.

@vnqtrang , Try like

Measure = distinctCOUNT(Table[ColumnName]) -

calculate(distinctCOUNT(Table[ColumnName]), Filter((table), LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR") )

 

 

Measure =

calculate(distinctCOUNT(Table[ColumnName]), Filter((table), not( LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR"))  )

 

or

 

Measure =

calculate(COUNT(Table[ColumnName]), Filter((table), not( LEFT(Table[ColumnName],1)="R" || LEFT(Table[ColumnName],2)="CR"))  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you ! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.

Top Solution Authors