Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure based off numbers

I have a column "sales" in dataset "data" and whether sale was made or not (1 = sales, 0 = no sales)

I am trying to create two measures for "sale" and "no sale"

I tried:
No sale = COUNTROWS(FILTER(data,data[sales] = "0")) but i get an error saying filter is not the correct syntax 
this usually works based off text but im not sure how to do it by number

looking through power bi forum found another measure:

No sale = CALCULATE(SUM(data[sales]); FILTER(data; data[sales]=0)))
but get same error for wrong syntax for filter

what would be the correct syntax for this or is my entore measure off for what I am trying to do? 

2 Replies

  • smpa01's avatar
    smpa01
    Community Champion

    Anonymous  this should work (whatever you are doing) without any issue. 

     

    Take a look here and post the pbix/sample data here for debugging

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you!! Worked beautifully