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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Melmehal
Frequent Visitor

DAX count number of occurence of value, using a filter and measure

Hi everyone, 

 

I have data that looks like this: 

In the measure, i have a formula that does a distinct count on the ID and filters where the category ID is = 100

I want to be able to now count the number of occurence in which a client folder appears when the category ID = 100 

the  measure works once i remove the ID and Category ID columns from the table, saying that client X appeared twice. Now I want to be able to keep this as static so I can do a count on the client that appeared more than once, and those that appeared just once. How can I do that?

 

IDClient FolderCategory IDMeasure
1X1001
2X1001
3Y1001
4Z1001
5A1001
6A1001
7A1001
8B1001
9N1001
10B1001

 

Once i remove the ID and category ID columns, this is what it looks like (which is what I want). Here i tried to filter where the measure = 1 but the moment i remove the client folder column, the measure just goes back to doing a total sum. 

 

Client FolderMeasure
X2
Y1
Z1
A3
B2
N1

 

Thank you in Advance for anyone who can help me! 🙂 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Melmehal 

If you want to count rows those more than once and those just once, you can take steps bellow for reference.

1. create a new table

v-xiaotang_0-1619780346477.png

Table 2 = SUMMARIZE('Table','Table'[Client Folder],"count",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Client Folder]=SELECTEDVALUE('Table'[Client Folder]))))

Result:

v-xiaotang_1-1619780435047.png

2. create the two measures:

Count_OnceMore = CALCULATE(COUNTROWS('Table 2'),'Table 2'[count]>1)
Count_OnceOnly = CALCULATE(COUNTROWS('Table 2'),'Table 2'[count]=1)

Result:

v-xiaotang_2-1619780535195.png

Hope it helps.

 

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Melmehal 

If you want to count rows those more than once and those just once, you can take steps bellow for reference.

1. create a new table

v-xiaotang_0-1619780346477.png

Table 2 = SUMMARIZE('Table','Table'[Client Folder],"count",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Client Folder]=SELECTEDVALUE('Table'[Client Folder]))))

Result:

v-xiaotang_1-1619780435047.png

2. create the two measures:

Count_OnceMore = CALCULATE(COUNTROWS('Table 2'),'Table 2'[count]>1)
Count_OnceOnly = CALCULATE(COUNTROWS('Table 2'),'Table 2'[count]=1)

Result:

v-xiaotang_2-1619780535195.png

Hope it helps.

 

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Melmehal , You can try a new measure like

sumx(filter(values(table[Client Folder]),[Measure] =1),[Measure])

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

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.