Forum Discussion
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
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π‘
8 Replies
- IdrissshatilaSuper 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π‘- VenkatzNew 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")))
- IdrissshatilaSuper User
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π‘