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
Anonymous
Not applicable

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? 
1 ACCEPTED SOLUTION
smpa01
Super User
Super User

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

 

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

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you!! Worked beautifully 

smpa01
Super User
Super User

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

 

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

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

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.