Forum Discussion

Venkatz's avatar
Venkatz
New Member
3 years ago
Solved

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

8 Replies

  • 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πŸ’‘

     

    • Venkatz's avatar
      Venkatz
      New Member

      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")))