Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.