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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
Community Champion
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

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
Community Champion
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

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.