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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors