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
Venkatz
New Member

Using Calculate and Filter in measure

Hi.

I am new to PowerBI.

I have extracted data from excel. I have a column called Gender which contains data as Male ,  Female, Not specified.

I have added a card to my dashboard and trying to get the count of Male . I have tried the below 

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER(ALL('Table 1 (Sheet1)'[Gender]='Male')))

 

I am getting error as - Parameter is not the correct type  ,  cannot find name 'Male'

How to fix this ?

Thanks

1 ACCEPTED SOLUTION

@Venkatz ,

 

try this

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER('Table 1 (Sheet1)','Table 1 (Sheet1)'[Gender]="Male"))

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

8 REPLIES 8
Idrissshatila
Super User
Super User

Hello @Venkatz ,

 

try putting male in double paranthesis like this "Male", so the measure would be like this

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER(ALL('Table 1 (Sheet1)'[Gender]="Male")))


If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi.

Thanks for the quick response. I am getting error now as "Too few arguments were passed to the Filter function. The minimum argument count for the function is 2. I have updated code as :

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER(ALL('Table 1 (Sheet1)'[Gender]="Male")))

Hello @Venkatz ,

 

try this 

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER('Table 1 (Sheet1)'[Gender]="Male"))

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi.

Thanks.  Apologies. Tried it and now getting error as Parameter is not the correct type.

 

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER('Table 1 (Sheet1)'[Gender]="Male"))

@Venkatz ,

 

can you show me a screenshot with the error and the measure.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi.

Please find the below

Error.png

@Venkatz ,

 

try this

Measure 2 = CALCULATE(COUNT('Table 1 (Sheet1)'[Gender]),FILTER('Table 1 (Sheet1)','Table 1 (Sheet1)'[Gender]="Male"))

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea💡

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you..

That worked

Helpful resources

Announcements
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.

Top Kudoed Authors