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
Anmolgan
Post Prodigy
Post Prodigy

How to calculate distinct count over a filter?

I want to calculate a distinct count of a column that is basically in text formula over filter where subtotale volumne is = 0.00, is there smartest way to do this? I want a measure of it because I then want to use this in my other calculations so need a measure of it. Please help?

1 ACCEPTED SOLUTION

Hi,

 

According to your description, i create a sample to test:

20.PNG

Then please try this measure:

Measure = SUMX(DISTINCT('Table'[Retailer Name]),IF(CALCULATE(SUM('Table'[Volumes]))>0,0,1))

The result shows the distinct count of Retailer whose sum of Volumes=0:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Try like

calculate(distinctCOUNT(table[column]),table[col]=0.00)

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

@amitchandak  I tried this but I am getting error related to, "dax comparison operations do not support comparing values of type text with values of type integer"

calculate(distinctCOUNT(table[column]),table[col]="0.00")

Or go ahead and chnage datatype to numeric

 

Datatype in new ribbion.png

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

But in my case I have text column where I have my retailer name and I have another column where I have maintained there volumes, now I want to find distinct retailers that have volumes more then zero how can I do this?

Hi,

 

According to your description, i create a sample to test:

20.PNG

Then please try this measure:

Measure = SUMX(DISTINCT('Table'[Retailer Name]),IF(CALCULATE(SUM('Table'[Volumes]))>0,0,1))

The result shows the distinct count of Retailer whose sum of Volumes=0:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.